Archive pages "edit" link goes to random page

I’m not sure why but on a couple of archive pages on a site I’ve built the main “Edit with Bricks” link loads the editor with a completely unrelated page and then has a dropdown link to “Edit Content: Events Archive” as well (which is the correct link).

Other archive template pages I have (ie for a news page) just link directly through that main Edit with Bricks link and have no submenu item.

I know it must be down to template assignments or similar but can’t figure out why these other pages are being associated with the Edit with Bricks link? The site is still locked for development pending client approval so I can’t give access just now but wondered if you could guide as to what I should be looking for to fix?

Do you have Rankmath installed? That screws with the templates in weird ways in terms of using the Edit with Bricks / Edit Template options

I thought you might have nailed the issue there @Pete as we normally install RankMath on all sites but having just checked that’s not the case here.

One example is the archive page for The Events Calendar events, I’ve got a template for this in place and it’s correctly applied, also confirmed it’s the archive which is being used by the classes

post-type-archive post-type-archive-tribe_events

being present on the body. If I hover over EDIT WITH BRICKS however the edit URL it loads is for another post from another post type entirely. In the dropdown menu, however, there’s a link to Edit content: Events Archive which loads the correct template to edit.

On another example archive, however, the EDIT WITH BRICKS link links to the right edit template URL instead of a random page and there’s no Edit content: News archive or similar link in the dropdown?

Ideally I’d want that EDIT WITH BRICKS link to go directly to either the relevant page/post or template, depending on the page being viewed but there’s inconsistency in what it actually does for a reason I can’t figure out.