This bug has been addressed in Unity 2023.1 onwards. Unfortunately the nature of the fix involves a change in the behavior of terrain that could require some user intervention. As such it does not seem like a good candidate for backporting to an LTS release.