Click on this link to read how to lock notes on your iPhone, iPad, and iPod touch --> How to lock or unlock notes on your iPhone or iPad - Apple Support
"Beginning in iOS 16, you have two options to lock your notes. You can lock notes with your iPhone passcode. Or, you can create a unique password only for Notes.
If you use your iPhone passcode, you don't have to create and remember a separate password. If you access your iCloud notes on more than one Apple device, use the passcode or login password for that device to unlock those notes.
If you use a unique password for Notes, there is no way to access your locked notes if you forget the password. If you forget this password, you can reset your notes password and use your new password to lock other notes. If you access your iCloud notes on more than one Apple device, use the same notes password to lock and unlock all of them."
Read the support article for details.
Did you try the passcode for the old device?