Half a dozen construction workers were within seconds of disaster when two building inspectors noticed the top of a building was about to collapse.