True. But, malware is not the only attack vector that HW needs to withstand. There are other vectors, like compromised RNG, compromised Firmware etc. exists for HW, which is not there for open source SW. So, one can't really say that a hot wallet on HW is more secure than a hot wallet on SW, just because SW is more susceptible to malware attack.
This statement is misleading for a number of reasons.
First, there exist open source hardware wallets. If your argument is that (some) software wallets are better because they are open source, then that argument fails when compared to an open source hardware wallet.
Second, "open source" is not synonymous with "immune to attack". There are plenty of pieces of open source software and open source wallets which have suffered from critical security flaws and vulnerabilities. Even Bitcoin Core has had a number of critical bugs discovered in it, some of which were exploited, such as the value overflow incident.
Third, malware attacks are exponentially more common than attacks which compromise the RNG of a hardware wallet or similar. Can you point to a single example where a compromised RNG on a reputable hardware wallet such as a Trezor or Ledge resulted in loss of coins? Because I can point to thousands of incidents of malware stealing coins from software wallets.