You turned the printer off when plugging/unplugging this connector?
When changing out hotends I have had instances where the connector wasn’t seated firmly. It’s usually pretty obvious when you turn the printer back on as the display shows a hotend temp of “0” instead of the ambient ~28 degrees it usually is. I will then turn the printer off and reseat it.
It also helps to actually push the 4 wires under the wire clip on the extruder housing before you plug it in. I have noticed that if I leave those wires out of the clip (as I did the first few changes) it often will result in a bad connection (and error). I now always push those 4 wires behind the clip first. Then connect the 4 wire connector and plug in the fan connector (I don’t bother putting the fan wires behind the clip) on top of it. Then I push the hotend up into the tool head body and secure with the screws last.
One more thing of note here, the way that connector is designed on the P1 series, it is possible to plug in the connecter incorrectly. Since both the top and bottom pin arrays are the same, I have accidentally connected the top pin array in to the bottom part of the connector. I noticed it before turning the printer back on so I don’t know if damage can occur.
I would be willing to bet it’s just a poorly seated connector causing your issue.