I don’t know about that. A lot of times companies will already have someone they want but they have to post a job listing for X days before they can fulfill it.
Full time hire process can take a long time and is why contract to hire can get you in the door faster.
I wouldn't assume that it's appropriate to shift people in a layoff to new roles within a company. I remember, when working at Intel, that some people were given opportunity (and preference) to apply to internal roles before being asked to leave.
That being said, not everyone is a good fit to transition to open roles. Other times, a certain amount of headcount turnover is healthy. (I personally felt like a lot of Intel's woes were due to the organization being too insular; and a certain amount of turnover would have helped them.)
Sometimes, companies shift engineers whenever they can before layoffs, and sometimes, they let go folks to rehire or hire back folks that were laid off if rehire proves difficult. I am not sure why companies do this but have seem it happens.
I've never heard of a company doing a layoff in the way you describe, eliminating thousands of roles and immediately moving those people into open roles throughout the company. It assumes the employees are fungible and will be a good fit for any open position and would lead to everyone knowing the layoff is coming well before its announced.