Alden,
Can you just confirm, because I may be misunderstanding the problem here if you are still looking at the side doors.
Is the issue you have with the tailgate?
Are the 2 rear side doors behaving normally?
I haven't had access to this forum today until now. Last night I assumed I had miss-read your OP and the problem you have is simply that the tailgate / boot door doesn't know when it is shut. I'm now slightly confused (more so than normal for me

). When I got home today I did a simple test to find where the tailgate closed switch is. I opened the tailgate to horizontal (low level boot area lights came on), and used a screwdriver shaft to close the latch in the bottom of the door. Boot lights went out, I was able to lock the car even though the tailgate was wide open.
That information might not help you if I haven't understood what is actually wrong with your car, but the switch which tells the car that the tailgate is closed is definitely in the latch. If the problem is that the car thinks the tailgate is open when it is shut, then either that switch or the wiring to it needs looked at. I already mentioned the wiring passes through a flexible rubber pipe between the car and the tailgate which would be what I would check first.