OK I have done some tests:-
Installed and booted from a test Ventura on a External
Signed into my test AppleID
Created some notes on iCloud and On-My-Mac
Ran Time Machine
Deleted notes
Closed Notes app
Browsed "Time Machine backups"
Restored (from before the deletions) the folder
~/Library/Group Containers/group.com.apple.notes
Opened Notes app
All notes had been restored,
but the iCloud ones disappeared before my eyes after a second or two.
I repeated but turned off iCloud Notes in Settings > Name > iCloud > Notes
Restored again
Opened Notes app
All notes present iCloud and On-My-Mac...and the iCloud ones did
not disappear in a couple seconds.
(Crucially at this point in a real world situation I would be able to copy all the iCloud Notes to On-My-Mac)
Then I turned iCloud Notes back on and the iCloud ones promptly disappeared again.
The problem obviously is that when iCloud Notes is turned on, the version in iCloud overwrites the local copy. So I signed in to iCloud.com and deleted all the notes there hoping that there would then be nothing to overwrite the restore. This was daft of course because the database was now empty so it overwrote the local database with an empty one. What I needed to have done was delete the iCloud Database completely, hoping the restored local one would be pushed to iCloud, but don't know how to do that.
I note that on iCloud.com there are Data Recovery options for Mail, Contacts, Calendars, Bookmarks, but not for Notes.
Conclusion
At this point the best I have achieved is to turn off iCloud Notes before doing the restore, then copy all the restored iCloud Notes to On-My-Mac, before turning iCloud Notes back on. Then you can copy the restored notes back to iCloud.
Does anyone know what the trick is to stop the restored notes being overwritten?