I don't think I can remember a time when DS has ever pooed in the night but he does do EW then poo. So I think the EW comes first and then because the body kicks into awake mode all the functions get going and moving.
I have no evidence of this, it's just a theory, but...I am wondering if DS gets EWs when his last meal has been a little too close to his BT milk. Although people tend to say fill a baby up with solids, rusk, rice, porridge etc before bed to get them to sleep through, I wonder if it is the opposite and they need milk to see them through. People who eat soup stay feeling fuller for longer so can the same be said of milk? So possibly a smaller solids meal in the evening followed by a really good BT milk could be the answer? Just a rambling thought.