"Only when..." vs "it was only when..."

You have to say either

It was only when she recovered from her shock that she became aware of its meaning.

or

Only when she recovered from her shock did she become aware of its meaning.


As written, you have a sentence fragment. "Only when" introduces a prepositional phrase. "That" introduces a subordinate clause. You need to have a main clause, and there isn't one.

Adding "It was" makes it a sentence, so that's correct. A different way to do it would be to change "that" to "did" and "became" to "become".