Background: Immanuel Kant (; German: [I'ma:nue:l kant]; 22 April 1724 - 12 February 1804) was a German philosopher who is a central figure in modern philosophy. Kant argues that the human mind creates the structure of human experience, that reason is the source of morality, that aesthetics arises from a faculty of disinterested judgment, that space and time are forms of human sensibility, and that the world as it is "in-itself" is independent of humanity's concepts of it. Kant took himself to have effected a "Copernican revolution" in philosophy, akin to Copernicus' reversal of the age-old belief that the sun revolves around the earth.
Context: In "Perpetual Peace: A Philosophical Sketch", Kant listed several conditions that he thought necessary for ending wars and creating a lasting peace. They included a world of constitutional republics. His classical republican theory was extended in the Science of Right, the first part of the Metaphysics of Morals (1797). Kant believed that universal history leads to the ultimate world of republican states at peace, but his theory was not pragmatic. The process was described in "Perpetual Peace" as natural rather than rational:  The guarantee of perpetual peace is nothing less than that great artist, nature...In her mechanical course we see that her aim is to produce a harmony among men, against their will, and indeed through their discord. As a necessity working according to laws we do not know, we call it destiny. But, considering its designs in universal history, we call it "providence," inasmuch as we discern in it the profound wisdom of a higher cause which predetermines the course of nature and directs it to the objective final end of the human race.  Kant's political thought can be summarized as republican government and international organization. "In more characteristically Kantian terms, it is doctrine of the state based upon the law (Rechtsstaat) and of eternal peace. Indeed, in each of these formulations, both terms express the same idea: that of legal constitution or of 'peace through law'. Taken simply by itself, Kant's political philosophy, being essentially a legal doctrine, rejects by definition the opposition between moral education and the play of passions as alternate foundations for social life. The state is defined as the union of men under law. The state rightly so called is constituted by laws which are necessary a priori because they flow from the very concept of law. A regime can be judged by no other criteria nor be assigned any other functions, than those proper to the lawful order as such."  He opposed "democracy," which at his time meant direct democracy, believing that majority rule posed a threat to individual liberty. He stated, "...democracy is, properly speaking, necessarily a despotism, because it establishes an executive power in which 'all' decide for or even against one who does not agree; that is, 'all,' who are not quite all, decide, and this is a contradiction of the general will with itself and with freedom." As with most writers at the time, he distinguished three forms of government i.e. democracy, aristocracy, and monarchy with mixed government as the most ideal form of it.
Question: Did he ever get in trouble for his beliefs?

Answer: