I think it's because they believe that a nightdress might flap around, while pyjamas won't, and, of course, no child would ever wear their bathrobe other than tied tightly around their body.
(Seriously, surely cotton is pretty flammable, even if it isn't melty-flammable like some synthetic fibres...
)
I suppose that, even though there are very few open fires these days, they feel that if they relax the regulations and someone gets hurt (or worse) they will be at fault, so we're stuck with a pretty irrelevant regulation.
If I was making a nightdress for a child I don't think I would worry about the fire retardancy, but I
would tell the parents so that they could take care if necessary.