A child’s Hajj is not worthless worship, but it does not normally replace the obligatory Hajj required after adulthood once the relevant conditions are met.
The quoted case specifically involves reaching puberty after iḥrām and simply continuing that iḥrām; it should not be stretched to every conceivable sequence of events.