As for the discontinuation of the iMac 27" it has more to do with iMac screen models looking weird.
Imagine back in 2021 Apple releasing the $1299 iMac 24" 4.5K M1 with a $1799 iMac 27" 5K M1.
Many will point as to why there is a $500 diff for the new 24" 4.5K screen vs the over a decade-old 27" 5K screen?
Product differentiation would be difficult.
Clearly there's not enough difference between a 24" and 27" iMac, in both size and price, to sell both. The 24" model, being exactly in between the old 21" and 27" models, was obviously intended to rationalise the iMac line into a single model.
Logically speaking the "big" iMac should be based on the screen spec of 32" 6K based on the 2019 Pro Display XDR.
Alas... the display parts for the 32" 5K isn't $500 more but nearly $5,000 more.
I personally don't see Apple releasing a 32" iMac, but if they did, it wouldn't need to use the same HDR FALD panel as the XDR display, and could just use a regular LED backlight. It would still need to be 6K, though. This is the downside to Apple's consistent 220ppi for all Mac displays - large displays need to have extremely high resolutions.
A 32" 6K HDR600 panel would be a custom order just for Macs, so would be expensive, and Apple would only be able to spread the costs over the sales of high-end iMacs. A 32" 6K iMac, presumably with at least an M3 Pro chip, would likely be over $3000; it would not be a volume seller, reducing the potential for economies of scale.
Bear in mind that once people saw the 32" 6K iMac, it would make the 27" 5K Studio Display less exciting; they would be clamouring for a standalone 6K Studio Display. Given Apple has priced the 27" model at $1600 (base), the 32" would start at, what, $2200? The iMac would need to be substantially more than that, given it would essentially have a mini Pro inside it too.
After 5 years it is my hope that next gen 32" 5K display parts will be nearer to $500.
Apple would never do a 32"
5K screen, as it wouldn't be 'Retina'. Given the economies of scale in the mainstream PC market, though, you could buy a 32"
4K screen for that today. For a little more, you could get one with 144Hz, DCI-P3 etc. They'd even throw in multiple inputs and a height-adjustable stand

Sure, it wouldn't be quite as crisp, but there's diminishing returns to this stuff. I'm typing this on a 27" 4K screen connected to a MBP, and it looks great.