I have encountered the same problem. I suddenly lost some notes and they were nowhere to be found????
Fortunately I had made back-up via my external harddrive.
What I did:
I replaced all note related files from User > Library > Containers >
com.apple.Notes
com.apple.Notes.datastore
com.apple.Notes.HTMLConverter
com.apple.Notes.NotesImporter
com.apple.Notes.QuickLookExtension
com.apple.Notes.SpotlightIndexExtension
And replaced all note related file from User > Library > Group containers
group.com.apple.notes
All back to normal.
REMEMBER TO BE OFFLINE I.E. OFF WIFI/ INTERNET, WHEN YOU REPLACE FILES!! Otherwise all files will sync with iCloud i.e. current situation!
I pinned the notes that I had lost and copied them too, I case there would be problems when back online — wifi/ internet.
All good, when back online
I still wonder how my notes could disappear — and case problem I still need to understand.