The Anshi Rebellion and feudal separatism during the Tang Dynasty were not due to Emperor Xuanzong's incompetence, but rather a result of the circumstances at that time.
The Tang Dynasty had a vast territory, which brought significant challenges, particularly in terms of border defense pressure. The situation in the south and west was relatively manageable, while the main stress was in the north and northeast. The appointment of military governors during Emperor Xuanzong's reign was likely a last resort; otherwise, border defenses might have collapsed.
However, there was actually another option: relocating the capital. Chang'an, at that time, was neither an economic center nor a border defense center, and it was too far from Hebei to provide effective support and restraint.
For example, if the Tang Dynasty had moved the capital to Kaifeng, or even made Beijing the "Upper Capital" with the imperial family taking turns garrisoning there, could it have avoided the pattern of the Anshi Rebellion?
In summary, since the Tang Dynasty, no dynasty has established Chang'an as its capital again; it was simply too remote.