my parents used to say the same shit about drinking before bed and nocturnal enuresis. it's wrong, makes the child think it's their fault, and feel ashamed for not "taking care of it" properly even though there's nothing they can really do about it.
it's caused by delayed development of brain regions (in the thalamus, mostly) responsible for bladder control during sleep. not "drinking too much before bed", not "anxiety", not "holding it in too much", nothing. It's just a part of the brain that didn't finish developing yet. sometimes it can take until puberty for bedwetting to stop. in very rare cases there is actually a pathological component to it.
there's absolutely nothing a child can voluntarily do to prevent it, especially not avoiding drinks, because your kidney never "stops" forming urine, and therefore your bladder never stops filling up, unless you're straight up dehydrated.
when the thalamic centers finally finish developing, you can drink as much as you'd like before bed and never have any "accidents", simply because your brain will wake you up if your bladder gets full. you can even dream about pissing all over the place and not spill a drop in reality.