It’s understood that the large Waitrose lorry was coming from Comely Bank Road and turning at the busy roundabout onto Orchard Brae when it struck the roadside railings on the corner beside the Flora Stevenson Primary School playground.
Emergency services raced to the incident which happened around 10.40 on Wednesday morning, shortly before a group of pupils left the building to go out on a bike ride.
Nobody was injured as a result of the accident but fire crews were called to free the trapped driver by sawing off a massive panel of the lorry from the railings.
Debris, including the panel from the lorry and section of the damaged rail, were left on the pavement and cordoned off with tape and traffic cones.
The accident has sparked concern from local residents and businesses about the ongoing roadworks on Craigleith Road and traffic build-up created by diversions in place at the roundabout.
It’s also claimed buses and larger vehicles struggle to make a sharp turn from Comely Bank Road onto Orchard Brae.
One local resident said: "When I came out the police were everywhere. At the roundabout it was total chaos. It was very dramatic. The lorry was a double wheel trailer and as it turned the front caught with wheels and axle. Fire engines and police arrived in a flash and while they were sawing off the broken railings a group of kids on bikes came out of the school grounds.
"The staff had to usher them carefully to keep away. I’ve never seen such a big lorry. He tore into that railing. After fire engines arrived and cut the lorry out the driver was sat outside on the school’s stone wall. I could see he was clearly shaken up.”
A shop worker who witnessed the incident added: “It’s lucky that pupils were not out playing at the time and nobody was hurt. I feel sorry for the driver. My son’s car was recently smashed just around the corner. Buses can’t get to where they need to go. The roads and turns are way too narrow.
"Because of all the roadworks on Craigleith Road, it’s very limited here just now. We’ve already had more than six months of road closures on Craigleith Road and it will be extended to February.
“We’re angry about it. This accident shows something needs to be done.”
A Police Scotland spokesperson said: "Officers attended at Comely Bank Road in Edinburgh around 10.30am on Wednesday, 11 May, 2022 following a crash involving a lorry and a fence."
A Waitrose spokesperson said: "Earlier today our lorry caught some road-side railings while turning a corner. We're really sorry for any inconvenience. Nobody was hurt, but we are taking this incredibly seriously and investigating how it came about."