For solving either mine and your "problem", or better say, leaving we both happy it would be more productive if Notes had an "undo" and a "redo" button.
Please don't assume you know what I would find more productive. You don't.
I already know and use other keyboards, like GBoard and Swiftkey (depending of what i'm typing). But if i accidentally erase a text, i can't have it back. I miss an undo button.
So, since you know that there are third party keyboards that have undo buttons and you want an undo button, why don't you use those keyboards? Or, just use Shake to Undo. No button required.
If you wanna suggest an alternative, you could thing about suggest using another App for writing notes or something like that.
I will suggest the alternatives I think make sense in the context of the question. As many apps use the Apple keyboard, changing to a different note-taking app might not resolve the problem. But, yes, you should consider other note taking apps if the built in one does meet your needs.