If your baby or toddler is wearing a disposable diaper when sleeping then there's no need to change a wet diaper at night unless it's bothering the baby.
If the baby or toddler poops then it's also okay to let the baby or toddler sleep through the night with a dirty or wet diaper as long as it's not bothering them.
When my kids were in diapers and they pooped I would let them sleep if I noticed they pooped at night or wet at night.
I always used diaper rash cream on the kids during the night and disposable diapers are very absorbent so as long as the diaper is not really wet and leaking then the child or baby will usually not feel any wetness.
I changed my kids diapers right before bed or after a bath when they were gonna be in bed within 30 minutes to an hour.
And if they pooped or peed then I just let them sleep.
If the baby is bothered by the wet or dirty diaper then they will wake you up to have you change them but if not then I would not worry about it.