There's no reason why the old Win32 window and widget foundation couldn't have been lifted on top of a modern rendering architecture though, there was certainly enough time to achieve this. This would also reduce the need for creating entirely new UI frameworks every year (or even better, higher level UI frameworks could be built on top of a modernized but backward compatible Win32 widget foundation instead of doing all their own rendering directly on top of DirectX).
(TL;DR: the Windows UI mess looks to me like an organizational problem, not a technological problem. From the outside it looks like as the old guard is leaving, the new people coming in discard all the old code and instead prefer to start completely new projects, which of course is destined to fail, because the new people are repeating the same errors which had been identified and fixed decades ago).