The property rights absolutist solution would be to build a wall on publicly owned land blockading the private property and reducing its value to nothing and then buying it from the owner at its new market price of zero.
When this happens in real life they can apply to the government for an easement, but that's practically communism, so we wouldn't allow that in this thought experiment.
https://www.investopedia.com/terms/l/landlocked.asp