The most likely cause would be syphoning, where the flow of water in the waste pipe empties the P-trap. This could be due to too small a diameter pipe and/or lack of vent in the pipework to prevent a vacuum caused by draining water. Did you change any other pipework apart from the P-traps?
If there's no leakage, something must be wrong with the unions where there's no water stored when water doesn't flow. I don't know what you used to connect the pvc/cpvc/abs pipes.. pvc glue, teflon tape... if everything is ok, and is the same model in both p-trap you should check the model reviews, if not, like one said, the diameter is really important when talking about p-trap (minimum diameter p-trap 1¼"). But with only one photo I can tell you more.