A panel needs room in front of it so a person can work on it and step back fast if something goes wrong. Depth, width and headroom are all required at once. Change the room and see what an inspector would call.
Where is the panel?
Panel width
Clear depth in front of the panel
Clear width, side to side
Headroom (floor to the lowest duct, pipe or joist)