I once avoided a layoff because it had been decided that I would be "on loan" to another group, rather than formally changing my position in the corporate hierarchy. I worked for them for over a full year and then they just disappeared over the weekend