The driver should have issued a transfer ticket. In practice they never do and passengers don't know that they need to ask for one. Phoning the Oyster helpline would probably have got you a refund.
If you sign up for auto topup you won't get caught out by running out of balance on your Oyster.