Bulk Mark as "Not Junk"

Hoping someone can help.

I have a problem with Mac Mail on MacOS 10.14, running a Gmail account.

Somehow (not sure how), I managed to accidentally move a folder of all emails I have received in 2018 from a ‘2018’ folder to the Spam folder. 11k messages. Not clever.

I logged in to Gmail and moved all the messages back. After a few minutes, they were back in the 2018 folder.

However, I now have two problems:

1 - all the 2018 messages moved are now marked with the banner ‘Mail thinks this message is Junk’. I have not been running Mail’s Junk mail filtering so I don’t know why it has appeared. Now that it is there I can not see any way of bulk editing all 11k messages as not being junk. I can do them one at a time, but the previous toolbar buttons to mark mail are no longer included in Mail. I have turned Junk Mail filtering on and off, resetting the junk mail filtering also, but this hasn’t had any effect.

2 - after marking some emails as not junk manually, they are still highlighted brown in the message list as if Mail thinks they are junk. When I go into the message there is no banner to mark it as Junk or Not Junk. This behavior is not consistent across all messages I manually mark as Not Junk, sometimes mail exhibits the behavior you would expect.

I’ve tried removing the account on all my macs and reading but this has not helped either and Gmail doesn’t show any tags or folders that might be causing this behavior as far as I can see.

Does anyone have any ideas on how to bulk edit all the emails to Not Junk and put this right?

Thank you