The Olympic medal ceremony was about to go catastrophically wrong.