This has been an expensive mystery of an issue in my y62 patrol 2013 v8 320hp AWD.
It started when the dealership replaced my ecu and actuator motor belonging to the transfer case to solve a lag issue.
Afterwhich they told me the transfer case needs to be replaced.
Finding them and the price ridiculous, got a used one installed only to find out the fork that holds one of the gears inside is broken.
The symptom here was the heavier gears wanting to engage when the car is not level meaning descending or ascending while I'm driving in normal mode speeds around 70-100 kmh.
A disturbing sound would come from underneath like gears grinding tips. And the problem would clear as soon as I hit the gas pedal.
We replaced the broken fork, but the problem still is. Could it be a software issue since something is clearing when I hit the gas.