The page was a classic WordPress page, and I recently converted it to a block. I added a custom code block, pasted the PayPal code, previewed the page (it worked), saved the page, and then got the message
This block contains unexpected or invalid content.
What am I doing wrong? Or is there an easier way to have a simple PayPal donation button using the block editor?
Likely something in surrounding HTML requires some refinement, as code you provided (what little there is) appears correct.