Let's be specific about what the "right kind" is for the benefit of future us (who will have forgotten). Maybe "The current node is a paragraph inside a list item, which isn't allowed and requires correction."

Also, once you move all of this into a sub-method, I would restructure this code so that instead of everything being inside this if statement, you check for the opposite of this first, and return `false` early. Then everything else doesn't have to be nested one level deep.