Op should tell her asap. Op caused this and if op truly cares about the situation they should take responsibility and the blame.
Worser cases reality 1: The panic attack was unrelated and Op is a stone cold bastard for not asking/showing empathy about it.
Worser cases reality 2: Gf thinks there was someone else and she had cheated with on accident, these panic attacks keep occurring as its settles as a deep trust issues complex.
Best case reality: Op tells her straight to the point and offers a sincere apology. Gf forgives op, and the relationship is strengthened in the long term.
Mixed reality: Gf is furious and dumps Op on the spot. They both dodged a red flag and were simply not compatible in finding eachothers boundaries. You don't pull jokes like that on a single whim, it’s clearly part of their nature.
This is a green text and probably fake btw.