Yes, companies can do some strange things....
It was 30 to 40 years ago that my brother took a job... moved to their headquarters... worked 4 weeks and was let go... he got caught in a power struggle and his boss's boss lost... the whole group was fired... which is why my brother was.... he got a package even though he worked 4 weeks... then two weeks later he got a call from the company wanting him to come back as he was the best qualified for the job... he did...
The other thing is that some of the higher ups make strange budget decisions (I did budgeting for many years, I should know).... they would require 'savings'.... you would have to show those savings happened.... but then you would be able to come back and show that you needed to 'invest' in something else and they would approve... so you would hire back the person you laid off for job X, but now they were doing job Y.... X and Y could be the same, similar or completely different...
I always thought it was stupid to lay off someone and then hire them back for any reason... at least in the same dept...