This disappearing notes issue has been a long, LONG-STANDING issue, with also some other long-standing issues, with the free and barebones features Apple Notes app.
I am convinced that this issue is not directly related to editing notes, thr Files app and/or using the Apple Pencil.
This disappearing notes issue can be traced back all the way to around the time of iOS 9 and 10!
There was NO issues with notes randomly disappearing before iOS 9 and 10 arrived and this has remained an issue ever since!
So much so, that I pretty much stopped using the Apple Notes app for ANY important notes keeping soon after I had two or three times where a significant amount of my important notes kept randomly disappearing and when sync'd with iCloud with all of my other iOS devices, those notes disappeared from iCloud and all my other iOS devices, as well.
My wife had run into the same issue,,but does not ever want to pay for apps, so she actually went back to handwriting notes with pen and paper notebooks.
I have been DONE with the free Apple iOS Notes app for nearly 6 years, now and have NEVER gone back to it.
Apple's free Notes app is a basic, barbones app that ONLY gets major changes/rework once a year with every new iOS/iPadOS iteration.
It is not a very good OR very robust notes app and I will just continue to advise everyone here to just STOP using it!
Save yourself the headache and heartache ( when your hard work creating lengthy notes that just randomly disappear without any hope of retrieval of these randomly disappearing notes ).
This is Apple's equivalent of its macOS Text or Simple Text app, which is also free, but has LOTS of limitations. too!
Most third party notes apps get steady and regular app updates to fix found/known bugs.
Most legitimate thrird party apps and note taking apps, in partcular, do NOT “mine” your data.
Most third party notes apps are more robust, more stable and just work better than Apple's free iOS Notes app!
Lots of Apple Pencil compatible third party apps to choose from.
Here is a long, but incomplete list of Apple Pencil compatible notes apps.
Pages
Bear
Collanote ( free )
Documents
EverNote
Inkredible
iAnnotate 4
Good Notes 5
Goodreader 4
Liquid Text
Margin Note 3
Microsoft One note
Nebo
Notability
Notepad+
NoteShelf 2
Notes plus
Notes Writer/(Pro)
Notebook ( free )
PenBook
QuickNotes X/ Pro
uPad
Write pad
Whink notes
Zoom Notes
PDF Expert
PDF Pro
Foxit PDF
Again, an incomplete list. There maybe more Apple Pencil compatible notes apps that I have not compiled.
Good Luck to You and to All Others Here.