After upgrading from WordPress 3.x to 5.x, when creating a new page (by default a page using Blocks), pasting text into this blocks view, selecting the text all and copying it and then adding a “Classic” editor block and pasting the content now there instead, I had the following problem:

p tags showed up the visual editor and the “Edit as HTML” editor view. However, they do not show up in the published code.

The solution I found to this was to carefully prune through the “Edit as HTML” editor view removing any classes adding to the p tags e.g.