Prosecuting, Gordon Menzies said: “Originally these windows had been designed to open inwards, an approach that the pros say is safe and simple – however the design was changed from inward opening to outward opening.

“The prosecution’s case is that the final design of these windows was not safe, and because of the design there was a serious risk that a gust of wind could prise them off their hinges.”

The design meant that the outward facing windows were held in place by a single metal “restrictor” attached to the window, the court heard.

“It had no effective failsafe, no reliable backup, there were many things that could go wrong with the restrictors and if they did, consequences could be catastrophic,” said Menzies.

Menzies said Foster + Partners and St James Group Ltd were likely to disagree about who made the decision to have outward facing windows.

Jurors were told that after the first window panel fell from the building and “miraculously no-one was killed or injured” on 18 August 2017, the developers failed to use the incident as a reason to “go back to the drawing board”.