The Royal Hospital for Children and Young People in Edinburgh was delayed just hours before opening due to a fault in the ventilation system.