Yes, you're right. For a TV, panel is what matters. Sony processing won't make a 200-nit edge-lit LCD perform better than a Xiaomi FALD no matter how good the processing itself is. And this is without taking into account that Sony also puts cheaper processors in their 80 series or cheaper.
First of all, a Mi 9 will blow the pants off the iPhone 6. Anyone who thinks otherwise is kidding themselves. And you can use GCam like
@vikrantxtrad mentioned which will further make images look significantly better.
Not to mention that Xiaomi's 18k Redmi Note 10 pro max destroys any Samsung sold below 30k in camera performance in real-world performance too. Obviously you can't compare it to S21 Ultra as The S21 ultra uses a custom sensor, way better SoC and hence ISP and better lens system.
About their new flagship device (Mi 11 Ultra), the camera is very close to the best as shown by various camera comparisons already. And it's significantly cheaper than S21 Ultra. Low light performance isn't a problem on any modern phone >20k.
Software doesn't matter as much on TVs. As I mentioned already, you can't beat a FALD TV with 1000-nit brightness with a cheapo Samsung/Sony with edge-lit 300-nit IPS panels no matter the processing. Regarding the UI, you can use an Apple TV 4k, firestick 4k or anything you want on a TV. It's not a phone where the UI matters to day to day usage as on a TV the UI is supposed to get out of the way.
Samsung/Sony/LG flagship TV > Xiaomi flagship TV >>>>>>>>>> not buying a TV > Samsung/Sony/LG budget TVs.
Tech will never trickle down to budget TVs from the top 3 brands. Else who would buy their top TVs. Even after 5+ years of FALD TVs their mid-range TVs don't have FALD. In fact, Samsung took away FALD from the Q60 and Q70 series over the years and now only their Q80 and Q90 have it.