Kids that have grown to the point they don't poop when they are asleep have crossed a hurdle. They typically won't go back to doing that.
SO, if he's doing it in his sleep he's constipated so much it comes out when he relaxes his core muscles. It's so heavy it squishing his bladder and pushing the pee out.
He needs to go have an ultra sound done of his abdomen, or X-ray. This should show how severe the blockage/constipation is. Either surgery will be needed to remove a blockage or Miralax will become part of his daily routine.
It's not a bad supplement at all.
IF he's not constipated according to the test results, you may not think he is but he may be, then there will be other things the doc should test him for.
It's not normal for kids to start pooping their pants when the go to sleep at night after years of not doing that. Something is going on inside him.