You don't seem to be disagreeing.
I assume by hardware margins you are thinking of component and manufacturing cost. However, the largest cost that has to be amortized over the life of a hardware product is R&D cost, which is huge.
Even by the component and manufacturing cost metric, the Switch has always been profitable, though DRAM and flash storage costs are putting pressure on hardware margins at the moment. Still R&D is the largest cost that each company faces.