I always thought a layoff/redundancy meant that not only does the employee loose their position, but the very position itself is eliminated.
Which means if the company hires a replacement for the same position including through a sponsored visa, then it's not a genuine layoff.
Nonetheless, I'm of the opinion that no single software engineer has yet lost their job to AI. It's simply not there yet.