Hi,
consider this:

What happened?
We had a project named 'DevOps'. We've decided to put it aside (wrong type and more reasons) and create a new DevOps project.
Step 1: Renamed the existing project to OldDevOps and changed its key to OLDDEVOPS.
Step 2. Created a new project 'DevOps'.
No problems so far.
Step 3. Tried to set the project key to DevOps and failed because the key can't be reused.
Decided on a slightly different key and set it ok.
At this point we had Jira rename all the issued in the old project to use the new key.
Step 4. Create a basic filter for the new project to be used on the default project board.
Here is the filter:
((project = DevOps and type in (Story, Bug, "RnD Field Bug", Epic)) and statusCategory != Done) ORDER BY Rank ASC
As can be seen, it refers to the new project name 'DevOps'.
Yet, when we run the query, issues from the old project come up and issues from the new project are omitted:

My guess is that this is thanks to the same 'feature' that let's you find an issue that was moved to a different project by its old name. Still, this is both confusing and irritating.
In a nutshell: do not reuse project name.