Hello and welcome to JustAnswer!
You've got a couple of possibilities there. The liftgate ajar switch is inside the latch. The problem could be the switch itself requiring latch replacment, or it could be a wiring issue. If the signal wire from the switch shorts to ground somewhere from the liftgate to the instrument cluster it will turn the ajar light on when the liftgate is closed. The fix for this was to remove the liftgate panel, find the two wire connector going to the latch for the ajar switch, and swap the wires in the connector.