I believe the same logic which Stalin applies in "Foundations of Leninism" to the national question also applies to your question:
"This is the position in regard to the question of particular national movements, of the possible reactionary character of these movements--if, of course, they are appraised not from the formal point of view, not from the point of view of abstract rights, but concretely, from the point of view of the interests of the revolutionary movement.
The same must be said of the revolutionary character of national movements in general. The unquestionably revolutionary character of the vast majority of national movements is as relative and peculiar as is the possible revolutionary character of certain particular national movements.
The revolutionary character of a national movement under the conditions of imperialist oppression does not necessarily presuppose the existence of proletarian elements in the movement, the existence of a revolutionary or a republican programme of the movement, the existence of a democratic basis of the movement.
The struggle that the Emir of Afghanistan is waging for the independence of Afghanistan is objectively a revolutionary struggle, despite the monarchist views of the Emir and his associates, for it weakens, disintegrates and undermines imperialism; whereas the struggle waged by such "desperate" democrats and "Socialists," "revolutionaries" and republicans as, for example, Kerensky and Tsereteli, Renaudel and Scheidemann, Chernov and Dan, Henderson and Clynes, during the imperialist war was a reactionary struggle, for its results was the embellishment, the strengthening, the victory, of imperialism.
For the same reasons, the struggle that the Egyptian merchants and bourgeois intellectuals are waging for the independence of Egypt is objectively a revolutionary struggle, despite the bourgeois origin and bourgeois title of the leaders of Egyptian national movement, despite the fact that they are opposed to socialism; whereas the struggle that the British "Labour" Government is waging to preserve Egypt's dependent position is for the same reason a reactionary struggle, despite the proletarian origin and the proletarian title of the members of the government, despite the fact that they are "for" socialism.
There is no need to mention the national movement in other, larger, colonial and dependent countries, such as India and China, every step of which along the road to liberation, even if it runs counter to the demands of formal democracy, is a steam-hammer blow at imperialism, i.e., is undoubtedly a revolutionary step.
Lenin was right in saying that the national movement of the oppressed countries should be appraised not from the point of view of formal democracy, but from the point of view of the actual results, as shown by the general balance sheet of the struggle against imperialism, that is to say, "not in isolation, but on a world scale"."
https://www.marxists.org/reference/archive/stalin/works/1924/foundations-leninism/ch06.htm
You can see here the same dialectical logic which i tried, in my own clumsy way, to explain in my other comment. It is not about what something is but about the role that it plays in the context of the struggle that you align yourself with. In the very first paragraph he makes it clear that function is what matters and not form. Also note the use of the terms "relative and peculiar" (peculiar not in the sense of "strange" but meaning here "unique" or "particular").
A regime with comparatively more reactionary elements can, depending on the circumstances, serve a more progressive global role than one with more seemingly progressive elements ("formal democracy") but which has aligned itself with the biggest force of global reaction: empire.
💯