The Prophet said this when informed of a child's death. Everything Allah gives He gives for a reason and everything He takes He takes with wisdom. Your child's time was complete in Allah's perfect plan.