Fiscal depute Gary Aitken made the comments during his closing submission in the fatal accident inquiry into the death of 12-year-old Keane Wallis-Bennett.
The first year pupil died at Liberton High School on 1 April 2014.
A free-standing modesty wall in the PE changing room crushed her.
Mr Aitken told Edinburgh Sheriff Court the inquiry had heard evidence the wall, said to have been built in the 1950s, was cracked before the incident, and it had fallen as a result of having "lateral force" applied to it which pushed it beyond its "tipping point".
A wall that collapsed on an Edinburgh school pupil and killed her was not with hindsight fit for purpose, a court has heard.