The death of a boy who waited more than two hours for a hospital bed has prompted a ”momentous” overhaul in one state.