As a general rule of thumb you will roll for however much time you need (if it is due to health or a PFA issue). In those case you will likely have to retake a PFA before jumping into a new class. I never saw anyone get to wait for a class to catch up to them. You were only in H class until you could go back to a normal class, but not a day longer (the caveat being that if you had made it to week 2-3 you would wait until a class finished indoc week, and if you didn't make it through indoc week you would wait for a new class to start before rolling in)
If you rolled for RLP or other inspection, you might very well go directly to your new class with no time in H-class. Always a blast to take your recently destroyed belongings to a new hatch and start the prep work over again.
If you passed an inspection, evalution or academic test in one class you would not need to retake that event (in most cases) in a new class.
For anyone waiting to go, don't worry about this stuff. You will learn when you get there that only a small set of things are actually under your control. I rolled twice, once my fault and once not really, but knowing about h-class wouldn't have changed that. Just go to OCS prepared physically, work hard and don't let anything affect you too much. The Navy wants you to pass if you want to pass.