Non-adiabatic particle dynamics in a time-dependent magnetic trap