This is largely not true these days. The Switch sold at a loss at-launch, but slowly turned a tiny profit as shipping prices went down. The modern revisions (Switch Mini and OLED) are also priced similarly, so any profits they're making off the hardware itself is incredibly marginal.