If the paper is submitted in a class that somehow has a connection to the previous class, then the student can claim to be doing ongoing research on the given topic.

This is complete nonsense. The test of whether it's allowed isn't whether or not the project is "somehow" connected to the previous class or what the student "claims." The test, as I've suggested earlier in this thread, is simply whether or not the professor would allow it if asked; and if you ask a college professor in just about any college course whether it's OK for you to use some of your research from a previous class (let alone any of the
content from your actual essay in that previous class) to fulfill a writing or research requirement in a current class, the answer will almost always be "absolutely not" and that the professor expects you to find a topic that you have not yet researched or written about for any other class. If you're afraid to even ask the professor, that means you already know that the answer is no.
It isn't plagiarism when you are doing continuing research on a given topic.
Obviously, if the project is part of ongoing long-term research within a longer post-grad program, that's a totally different situation than what the OP asked about in connection with "two courses." Trust me that no doctoral candidate needs to ask anybody on this forum whether it's OK to continue his long-term research project within his long-term growing expertise in his chosen area of research. We're talking about undergraduates who are thinking about reusing work from one course to fulfill the writing requirement in another course. Obviously, the projects and the two courses at issue have to have some content "connection," because if they didn't, the opportunity to reuse a project wouldn't ever come up in the first place.
Professors can take that into consideration and decide whether or not the student can be allowed to do the continuing research for the new paper.
Professors know full well whether they're teaching graduate students engaged in long-term research that bridges consecutive courses or just undergrad students who sometimes take courses with some overlapping content, whether subsequently or even concurrently. Except maybe in very rare circumstances, professors absolutely prohibit using any research already conducted for a previous course, and even then, it would only be with their explicit permission in advance. No undergrad professor will ever allow a student to "rehash" anything from an old project or to submit anything already written for a previous course. Whether or not you'll necessarily get caught doing it and want to take the risk is up to the student; but there's no question that it's never allowed without permission in advance and that permission to do so is almost always denied.