Some of these juntas (Belem and Salvador, I believe) even went as far as to reject the authority of Rio de Janeiro and declare loyalty to the new Lisbon government *only* .
Yes, both preferred to be governed by Portugal (or at least the elite preferred it). Salvador ended up becoming a polarized provincial capital, there was a (large) group of defenders of Lisbon. Another “aristocracy” group that defended a Brazilian state. And a “third way” that wanted independent provincial governments.
I also remember reading that the Portuguese troops stationed in Brazil were very sympathetic to the liberal movement, almost managed to force Pedro to leave as well.
It's more complex than that. The War of Independence can be considered a Portuguese-Brazilian civil war, as Portuguese and Brazilians fought on both sides. So certain troops were in favor of the revolt or others were not. There was a split in the Portuguese-Brazilian Army that occupied Cisplatina (Uruguay). Portuguese regiments retreated to Montevideo and were surrounded by their former comrades. In the remote and sparsely populated north of Pará and Maranhão, pro-Portuguese junta declared loyalty to Portugal. Pernambuco was in favor of independence, but in Bahia, there was no consensus among the population.
As a whole, Portugal is playing against time, the longer the war goes on, the worse off they are. The Portuguese advantage was a larger navy than the Brazilian one. With the Brazilian navy having 38 ships and the Portuguese 55 in 1822. But even with the navy it is a fight against time, two years later the Brazilian navy would reach 90 ships while the Portuguese remained at the same size. With Portugal losing at sea after Brazilian naval growth.
PS: Portuguese troops were a minority in the country. We see this in the most pro-Portugal province, in the region. The interior and the capital, Oeiras, remained under the control of Portuguese troops, and achieved victory in the battle of Jenipapo. But with certain key cities, especially Parnaíba going in favor of brazil. They ended up making the Portuguese victory impossible.
Between sympathisers of the Lisbon government (both Portuguese and Brazilian),
Meh, this is a two-way street. We have supporters from Rio de Janeiro (Portuguese and Brazilian alike)
Brazilians liberals who might otherwise be interested in independence but resent his absolutism,
This will be the biggest factor in how much support Portugal can get from the locals. The biggest problem with this was the fact that Portugal wanted to recolonize the country. If it were a contest between absolitism and liberals in the dual realm, the liberals would win. The problem was to gain majority Brazilian support in a project to kill the Brazilian kingdom.
separatists wanting to create independent republics
Interestingly, separatists were not very strong during this period (especially when compared to pro-Portugal and pro-Brazil groups). For example, the Uruguayans revolted in 1825 not out of a desire for independence but as a result of promises of autonomy not fulfilled by the central government of Rio de Janeiro.
it seems to me that he would face intense pressure from all sides.
Certainly, this would probably lead him to have to reach a compromise with the Brazilian elites in order to have a cohesive mass. Which could make the country more decentralized in the future.
That's very interesting, I could see Northern Brazil and most of the Northeast either remaining a part of the Portuguese Republic
I tend to agree with
@Phalamus , the best possible result for Portugal is to be able to keep Maranão and Grão Para.
João VI was an absolutist but he wasn't as reckless
A curious thing is that this commitment between the king and the elites keeps Cisplatina from revolting.
would be a likely place for a sort of Portuguese Canada in South America.
Less Canadian and more English Normandy. A region with a stronger neighboring power will want the region back in the long term. As a whole, Portugal losing Brazil but receiving money was the best thing for them. Keeping part of Brazil means a round 2 against Brazil. And in the OTL they lost naval superiority against the country in 2 years of war. Maybe it will take 20 or 40 years, but overall Portugal is much weaker in maintaining the region.
Could there be a compromise allowing the Cortes to get what it wants the most without him having to leave Brazil?
No, because the court wanted the death of Brazil, its relegation from kingdom to colony, and its exploitation in favor of Lisbon.
As a whole the courts were living in a fantasy world, in which they were the stronger of the two kingdoms. Portugal in 1820 had 3.29 million people, Brazil had 4.71 million. In 1850 Portugal had 3.82 million and Brazil had 7.25 million. Instead of accepting that they were the lesser of the two and simply reforming an economic agreement between the kingdoms. They tried to break the stronger of the two and what saved the rest of the Portuguese empire was English interference.