Voltage for bottom tailgate switch comes from the same fuse F84 as for the relay.
When you open upper tailgate is the interior lighting coming on so body module recognises that it's open. (Body module will prevent bottom tailgate opening if upper is not open.)
https://bmwteka.com/wds/en/e53/a6beb929