What is the motive to live in a high cost of living area? Usually the two biggest reasons are economic and social opportunity. Economic opportunity is irrelevant in this instance if UBI cancels out in the two locations. Will there be enough social opportunities for people to leave their friends, family, and home country to move to a higher cost of living area?
The exact same is already true for minimum wage and salary in general, and while some people do migrate, there has arguably been no society-ending migration wave due to this reason. This is a common trope that has no basis whatsoever.
Although you can move freely to any country, to recieve benefits in a most countries you need to have had a job for 3 months before you can claim any benefits.