I‘m worried

Hey guys, i'm really concerned. This is my 10 month old cockatiel named hamudi. Ever since we got him 3 months ago, he's been having these „episodes" where he zones out for a couple seconds (like in the video) and leans his head against the wall afterwards. At first we thought he was partially blind but once he snaps out of these episodes his vision is completely normal. He eats and drinks, he plays around like a normal cockatiel otherwise. Another weird thing about him is that he can't fly properly. We've been trying to train him, but he's not making any progress. His former owner told us that he's always been like that. Has anyone ever seen a cockatiel behave like this? Could it be a sign for something bad?