Sounds similar to what Irish Ferries did a few years ago. Redundancies of this nature are much easier in shipping than in other areas, as contracts are effectively fixed term for the voyage and later renewed. It makes bussing in of an entire replacement crew entirely practical.
Even so, they could have, er, jumped ship to a different employer or even industry.
Before Brexit Dover-based P&O had all it's ships registered in the UK though, so when a lot of the staff joined, it would have been a UK based job, with a UK-based employer on UK-flagged ships
There are no UK owned international ferry companies. Even if there were, it wouldn't stop actions like this happening (Irish Ferries are Irish owned and did similar). If the ships had been UK flagged this morning it would have been entirely possible to reflag them at the same time.
One thing that is interesting with Irish Ferries was that there are now a lot of UK and Irish officers on the ships, working for decent wages. The main reason for the change was to get rid of very expensive legacy contracts, and heavy union involvement, not a change of nationality specifically. I wonder if similar may be the case here. The RMT in particular is seen as difficult to work with by shipping management, and unlike in the rail industry, it is entirely possible to enact a solution like this to remove their influence.
I know some great people at P&O, so I really feel for the people who are impacted by this. For officers there are lots of jobs available in shipping at present, but I suspect the British ratings will have more difficulty finding a new place to work