Sounds like you need to test the replacement latch. The tailgate grounds through the CDL switch in the RHF (UK Drivers) door latch - so if that is open circuit the car will think it's locked, and as it never changed state, it won't think it's been unlocked properly, and the tailgate won't work...