A relative clause can be introduced by either a relative pronoun or a relative adverb. A relative clause can be restrictive or nonrestrictive (essential or nonessential) Restrictive relative clauses ...
In this case, ‘Not until I saw what happened’ is the adverbial clause. The inversion takes place after this, in the main clause. This happens with 'Not +time' and 'Only + time'. 'Not since ...