You should have mentioned that you used the ZMPT101B MODULE. Unfortunately, and I’ve written this several times previously:
The ZMPT101B MODULE is totally and completely useless for measuring real power.
It’s OK to use the transformer, on its own.
It includes an op.amp and a filter circuit that introduces a large and variable phase shift, which makes any attempt to synchronise the voltage and current measurements - and you must do that to read real power correctly - almost impossible.
Had you written that you were using this module, I could have saved you two months of problems and investigation…