(1) Not only the bathroom was flooded, but also the rest of the house (was flooded).
In the first clause, “only the bathroom” is within the scope of “not”; in other words, “not” negates “only the bathroom.” “Not” does not negate the flooding of the bathroom.
Try to find this reading one step at a time: The bathroom was flooded. Only-the-bathroom was flooded. Not-only-the-bathroom was flooded.
The conclusion you should draw at this stage: in (1), the combo “Not only” does its thing to the subject “the bathroom” only. It naturally fronts the subject. “Not only”(with auxiliary) and “the bedroom” do not trade places; hence there is no
negative subject-auxiliary inversion (NSAI) here, and the word order in the clause is canonical.
(2) Not only do they need clothing, but they are also short of water.
Find the reading of the first clause in (2):They need-clothing. They need-clothing-only (or They only-need-clothing). They not-only-need-clothing (because they need more than clothing). Here “not” negates “only-need-clothing”
For emphasis, we pull “not-only” from behind the subject “They” to the front of the sentence. But “not only” won’t go alone and drags the auxiliary with it to complete NSAI.