Likely a problem with the latch mechanism - there are multiple position switches, actuator, etc. in there.
To confirm - Can you open the door 'manually' by pressing and holding the button on the hatch and opening it that way, or is the only way you can open it to disconnect the battery? There is also an 'emergency' release that you can access by popping a plastic door near the latch mechanism and moving a lever.
I would start with the test procedures in the service manual focused on testing the latch mechanism.
-Charlie
To confirm - Can you open the door 'manually' by pressing and holding the button on the hatch and opening it that way, or is the only way you can open it to disconnect the battery? There is also an 'emergency' release that you can access by popping a plastic door near the latch mechanism and moving a lever.
I would start with the test procedures in the service manual focused on testing the latch mechanism.
-Charlie