Bridlington Magistrates’ Court heard that on 26 June 2019, Harlands Builders Limited was undertaking groundworks at a site in East Riding.
The worker had entered an excavation in order to measure the depth when part of it collapsed on him.
An HSE investigation found that the excavation had three sheer unsupported sides and was not battered back.
The worker was trapped by the collapse and sustained a broken tibia and fibula on his left leg. Other workers were also put at risk as they went into the excavation to free the trapped man.
Harlands Builders Limited of Bridlington, East Yorkshire pleaded guilty to CDM breaches and was fined £12,000 and ordered to pay costs of £1,139.
Speaking after the hearing, HSE inspector Sarah Robinson, said: “The excavation should have been supported or battered back, and no individuals should have been asked to go into the excavation whilst it was unsafe.
“This incident could have led to the death of the worker. The case highlights the importance of identifying and following any risk assessment that was set in place.”