Cannot create filtered deck without error

Hi everyone!
I use filtered decks quite regularly and wanted to try out if I can create one with only flagged cards. I got an error message to start Anki while holding the shift button, which I did. Having disabled all the add-ons that way, I tried to create the filtered deck again, only to receive a message that I would be directed to this page and should add this into my report:

Caught exception:
Traceback (most recent call last):
File “aqt\”, line 127, in accept
File “anki\”, line 1068, in rebuild_filtered_deck
File “anki\”, line 171, in rebuild_filtered_deck
File “anki\”, line 256, in _run_command
anki.rsbackend.InvalidInput: Invalid search - please check for typing mistakes.

Does anyone know what can be done here?
Thanks in advance!

I accidentally left out half of the message I was supposed to copy, here is the first half:

Anki 2.1.38 (355e4cd5) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=False sv=1
Add-ons, last update check: 2021-03-06 22:59:49

As it says, your search is invalid. You can post it here if you need help with that. (Also, Anki 2.1.41 will show a proper error message.)

Thank you for your reply!
After trying around some more, I at least got to the point where it tells me that my search did not match any cards. I have flagged some cards orange and wanted to study specifically those, hence why I added “flag:2” after the deck in the search expression. For some reason it can’t find them though…

I suggest you update to 2.1.41, update to the new scheduler, and then try again. If you continue to have problems, there’s a link in the filtered deck screen to show which cards are being excluded.