A hard fork which makes the refund transaction invalid effectively steals that output.
You mean a soft fork.
A hard fork should not cause that. It should only make invalid transactions valid, not the other way around.
However, a hard fork could enable a new type of "lock breaking" transaction that allows the locked coins to be spent before the expiration date. That would invalidate the refund transaction, which would be rejected as a double spend.
I don't know whether such a change would still qualify as a hard fork, though.