I has to put my yellow tang in a 29 gallon temporarily while I moved and he did something similar. Would swim from one side of the tank to the other really fast and would accelerate and decelerate, like his throttle was stuck or hitting a limited but wanted more speed. When he went in my display he acted fine again, so if it is the same behavior I am going to say it is related to the small tank size.