May take some time before someone sees and has a for sure answer for you. May be a switch located somewhere on tailgate is loose/failing somehow , or another wiring issue involving circuit
Some cars have the lift gate sensor integrated into the latch, others have a separate switch. Very often, a loose wire to the gate ajar sensor can ground and create this intermittent and random type of warning.
Answers