Although it sounds absurd, the fact is, the Jade Emperor pursued Yang Jian, not to harm him, but to save him.
In fact, this is not hard to understand. Even if the heavenly soldiers were useless, they were still heavenly soldiers; how could they possibly pursue Yang Jian for hundreds of years without managing to kill him, yet instead, help him grow stronger? It was nothing more than the Jade Emperor intentionally going easy on him, using the soldiers to hone his nephew.
As for Nezha, by the time the Enshrinement Calamity erupted, he had already died once.
Returning his flesh to his mother and his bones to his father, the moment Nezha died, he had, in fact, already escaped from the calamity. After his revival, re-entering the Enshrinement Calamity, he naturally passed through it without disaster or tribulation.