This phenomenon is not specific to any country as I have noticed it stretches across multiple regions and countries.
For example, marijuana is illegal in the United States at the federal level despite it's use and sale being effectively condoned by both the federal government and several state governments. However, a repeal of the federal law that made marijuana illegal is still not seen as politically viable.
In another United State example, many migrants illegally enter the United States through the southern border with Mexico. However, there is neither a political consensus around making immigration laws more open for immigration nor around making illegal immigration more difficult. By default however, the effective policy in this specific area is one of quasi-open immigration. It's a common anecdote that one of the strongest opponents of illegal immigration are often the people who go to home improvement stores to hire illegal immigrants for various construction projects.
The context around migrants illegally entering the UK is slightly different, but largely the same.
In the Israel and Palestine conflict, neither side believes a 2 state solution is viable, but neither side will publicly change their position on it. The effective policy (for the time being) is to leave things as they are, but neither side is able to change the official position.
You'll also see in several countries with weaker governments that taxes are heavily evaded, but efforts to lower the official tax rate or increase enforcement have no public support.
I would summarize these discrepancies by saying that society has certain ideals that they don't want to deviate from but aren't willing to acknowledge the deviation in real life either. So the law says one thing, but society does another. Is there a name for this in political science? Is there a Political Science explanation for this phenomenon?