I don't know if anyone is regularly dealing with this problem but I pulled my hair out all weekend on this issue. I just bought a 2003 Yukon with the rear access ajar message. After reading some threads and diagnostic "how-to's" I started with disconnecting the battery and draining all the systems by touching the neg and positive harnesses together. This helped temporarily but the problem came back.
I then started ringing out the status wires from the tailgate. The glass latch and both gate latches all register a open circuit when closed and a short circuit when open, which is normal.
I then pulled apart my drivers door panel to investigate the door lock actuator as someone suggested. In doing so, I took apart the DDM (power window, lock button) and discovered one of the circuit boards that has the copper trace for the unlock button to depress onto was corroded and sending a constant "unlock" request to the BCM which was draining my battery overnight. I figured by scratching the corrosion away, this would solve myproblem. I was wrong but it did solve my battery drain. I then checked the door actuator. The status pins, and unlock/lock functions all worked fine but I did take the opportunity to clean it up and spray it with WD40.
I then moved on to checking for the status indicators at the BCM for the rear hatch - nothing abnormal. Then I pulled all the harnesses out of the bcm and let it sit for about an hour. I checked the internal circuit board for any obvious signs of damage but did not see anything. When I plugged the BCM back in later, I no longer get the "ajar" message and I can now set the alarm. Its been 24 hours since this "fix" and I still have no problems.
Now, I don't know what I did but I am assuming that by unplugging the BCM, I effectively drained the capacitors and memory of the on board chips. I know that disconnecting the battery should have done the same thing but this is the longest the truck has gone without displaying that annoying message. I will keep you informed if the problem comes back or not.