Grossly inadequate working clearances are not always simple black-and-white situations. Code clearances have evolved over decades through injury and death, but there may be times when it’s difficult to flatly walk away from such a situation.

If there’s no fixing the root problem, insuring adequate workspace lighting, clearing all things practically movable, thoroughly covering all foreign components that encroach the code-mandated workspace with 600V-rated insulating material, and in particular, having a ready, qualified, experienced emergency-trained observer present during the work may be in order.

Although possibly seen as punitive by some, the effort and cost of such measures should be somewhat immaterial, say, when compared to a potential insurance payout.