At this point, no one outside of Apple really knows if this is a hardware problem with the phone's design (e.g., the antenna) or software (e.g., baseband chip firmware) or a combination of both. The WiWavelength blog's analysis of the FCC filing by Apple notes that the antenna used in the XS phones has lower gain than other iPhones. Antenna gain affects both the transmitted signal and the received signal. If antenna gain is low, you can increase power to overcome it but this probably won't be acceptable in a cell phone since the FCC places limits on power output. It would also destroy battery life. I haven't seen any analysis of the FCC data other than the one by WiWavelength and I don't know how much weight to give that person's opinion. Poor antenna design probably can't be overcome with software tweaking. But it's hard to imagine that Apple's engineers designed a poorly performing antenna unless they had to compromise to meet some industrial design limitations imposed by Apple's industrial design department.
Regarding software, some have suggested that the XS phones are prioritizing bands that in theory should afford faster LTE data transmission, but those bands can have more limited range. A comparison would be like 5 GHz WiFi offering faster data throughput, but more limited range than 2.4 GHz WiFi. The phone should automatically switch to a stronger, slower band signal when the faster band is weaker, but that might not be happening. This may be why temporarily putting the phone in airplane mode can make the phone grab the stronger, slower signal for a short time before switching over to the weaker band. If this is the problem, it should be fixable in a software update.
I have an XS Max that has very poor LTE data speeds on the Verizon network when I'm in areas showing one or two bars on the phone. Verizon gave me a new SIM card and I reset the network settings to see if it would solve the problem, but that hasn't made a difference. My return window is up in one week, and I need to decide whether to gamble that Apple can address this in software. I like everything else about the phone, but it needs to be a phone first.