My mare does this too. I make her work extra hard when she acts up. If she jiggs, bucks, bolts or bunny hops I make her trot in tight circles. She doesn’t like that anymore because she knows she gonna have to work more.
Could be wrong but might possibly be over excitement for going home? Maybe if their is a back enterance to your property going out one way and in the other might help