Spanish America was this. At the top of the specifically Spanish American hierarchy, you had the Council of the Indies, which acted as a court of appeal for all of Spanish American but only for civil cases which consisted of high amounts of money in dispute, or if the viceroy disagreed with the ruling of the colonial courts. It could also issue ordinances and had broad oversight powers over the Americas. This body varied over time, being fairly strong in the Hapsburg era, weakening during the initial Bourbon era, and This is fairly simple, but then we have more complexity.
Below this, we have the viceroyalties, each nominally ruled by a viceroy. Due to audiencias, colonial courts I'll get into in a second, they had little real power although this varied, they primarily executed laws, and since they were military men, they also served as commander-in-chief. Below the viceroyalties, there were a few captaincy-generals, ruled by captain-generals who had the same power of a viceroy, just in a smaller domain. Nominally, a viceroy was superior to a captain-general, but since both were directly appointed by the Council of the Indies and due to distance, the two were virtually independent of one another. There were also governors and below them corregidores, with the latter just being lower-level governors, and during the Bourbon era, intendants were appointed who controlled finance within an era. The rule of an intendant could be over multiple provinces, and they were used to centralize power to a massive degree. And they also listened to some civil cases, weirdly enough.
Talking about colonial councils, we primarily have audiencias, which were originally designed to be consultative bodies, but by the Bourbon era they were courts of final appeal (except for the ones to the Council of the Indies). Their rulings had to be adhered by the viceroy and captain-general, even if they disagreed. Furthermore, what a ruling consisted of was so vague that they also had a quasi-legislative power, but since Spain regularly issued compilations of the Law of the Indies, this was restricted. They also had quasi-executive power - for instance, new cities and settlements had to be accepted by them, tribute from natives was assigned by them, and they appointed judges and corregidores. Also, they put all administrative officials on a review at the end of their term through what was known as a residencia, and with this, an audiencia could exert even more power since with this review it could even imprison administrators. The nominal President of the Audiencia was usually the viceroy or captain-general, depending on who was in its city, but since viceroys and captain-generals were military men, they know nothing about law, and so the audiencia chose a Regent of the Audiencia to chair its meetings. This is except for the Audiencia of Quito, which had no viceroy or captain-general and so the audiencia just appointed a president. Also audiencias varied widely in size - some were unicameral and had single-digit numbers of judges, while others had separate chambers for civil and criminal cases. And the audiencia alone carried the royal seal necessary for some functions, and so that further established their power. To summarize - audiencias were primarily judicial, quasi-executive, and slightly legislative.
And below the audiencias, we have cabildos, municipal councils consisting of notables. But that's just your standard oligarchical municipal council.
Now, let's assume that there's no Peninsular War and so Spanish America remains loyal. Now, let's say Spain decides to democratize its empire. I would expect what they'd do is create legislatures co-geographical with the audiencias, which would also serve the purpose of making Spanish America divided and weak. These legislatures would have limited power to create laws, and I imagine all proposed legislation would need the royal seal, which means approval by the audiencia. Thus the audiencia would also serve as a sort of upper house, to be added to its various functions. Alternatively, or simultaneously, a democratized Spanish America could have the cabildos nominate/elect judges of audiencias. Thus, we'd have an indirectly elected body simultaneously judicial, legislative, and executive.
And it would be this administrative clusterfuck that would gradually become independent, assuming Spain is led by smart enough people to pursue gradual separation.