Sure, they aren’t just in the monitor business and they had been fully out of that business but in 2019 they got back in. Regardless, having good monitors adds value to their MacBooks and others in the Mac line. I don’t think that Apple is missing any margin on the Studio Display and I doubt that their margin on a cheaper XDR would fall below their typical margin once they ramped up production.
Right they are not missing any margin on 27" Studio Display because how expensive it is for what it is. It's just that there are a lot more people that can afford that price even if it's expensive. They are basically charging the price of an iMac for a monitor that's pretty similar to the tech from 10 years ago on a 5k display.
The question would become what panel tech would they use for a hypothetical 32" display and how much is that costing them. Whatever it is the Apple tax will be very high as they are not trying to sell monitors at competitive prices to compete with Korea/China companies which you can never win. They want lower volume, high margins higher quality.