Alright, guys, here it is: had to consult an Apple senior engineer (the commendable Jason) to get my notes back. While the underlying problem remains unknown, below is a manual workaround to get the notes back using TC and some fiddling with files. Also, at the moment the problem occurred, the Notes app did not automatically sync to iCloud despite the option having been checked since long. Today I moved the content of Notes manually to iCloud (from within the Notes app) and with that it is supposed to properly sync to iCloud in the future.
Here is the workaround as I recall it:
macOS MOnterey: all notes missing from the Notes app (On My Mac)
- Quit Notes app
- Disconnect physical internet connection
- Switch off WiFi
- Go to: ~/Library/Group Containers —> group.com.apple.notes
- Time Machine: restore suitable group.com.apple.notes
- Copy NoteStore files (ALL THREE SIMULTANEOUSLY) from group.com.apple.notes to desktop, then move them to trash (DON’T EMPTY TRASH)
- Reconnect internet connection
- Switch on WiFi
- Verify content of Notes (should be empty), quit app
- Put back NoteStore files (ALL THREE SIMULTANEOUSLY), opt to replace existing ones
- Uncheck, then recheck iCloud —> Notes
- Open Notes (On My Mac), content should be restored