I think reordering the steps meets the condition for novelty, provided the first piece of prior art makes sufficiently clear that A must be performed before B. (If it's not very clear on this point, and either way would seem to work, then proposing a particular order may not be novel after all).
Obviousness may be harder to beat. It sounds like an unusual hypothetical where the author of the first piece of prior art didn't realize there was a "major flaw" in it. If the flaw is subtle, the later inventor may be able to argue successfully that he/she was the first to identify the problem with the prior art solution, which is an argument that usually carries the day even if the improvement appears to be superficially trivial (merely reversing the steps).