If my 10 year old son pooped in his bed wetting diaper I would believe that he liked the diapers and wanted to stay in them.
So I would make him stay in the poop diaper for a few hours and then change him into a new diaper.
I then would lock the bathroom and make him use the diapers for both poop and pee and would keep him in his diaper and shirt at home.
That would make it easier to keep check on his diapers and change him when needed.
I would also treat him like a baby and make him drink from bottles, suck on pacifiers and then also sleep in a crib.