It sounds like you're talking about this incident involving the Holy Roman Emperor Sigismund at the Council of Constance in 1414:
…A similar anecdote is told of the German Emperor Sigismund. When presiding at the Council of Constance, he addressed the assembly in a Latin speech, exhorting them to eradicate the schism of the Hussites. 'Videte Patres,' he said, 'ut eradicetis schismam Hussitarum.' He was very unceremoniously called to order by a monk, who called out 'Serenissime Rex, schisma est generis neutri.' The emperor, however, without losing his presence of mind, asked the impertinent monk, 'How do you know it?' The old Bohemian schoolmaster replied, 'Alexander Gallus says so.' 'And who is Alexander Gallus?' the emperor rejoined. The monk replied, 'He was a monk.' 'Well,' said the emperor, 'and I am emperor of Rome; and my word, I trust, will be as good as the word of any monk.' No doubt the laughers were with the emperor; but for all that, schisma remained a neuter, and not even an emperor could change its gender or termination.
Source: The Science of Language, Founded on Lectures Delivered at the Royal Institution in 1861 and 1863 by F. Max Müller, K.M., pp. 39–40. (1899)
A long footnote in this 1845 German translation of the poem Hudibras gives Sigismund's sentence as "Date operam ut illa nefanda schisma eradicetur" and attributes the correction to a Cardinal Placentius: "locutio parum grammatica". After a similar interrogation leading to Gallus and Priscian, Sigismund retorts that as Caesar, he outranks those people, and he can very well make a different grammar.
In some versions of the story, like the one in Wolfgang Menzel's 1852 History of the Germans, Sigismund's rejoinder is:*
Ego sum Rex Romanus et super grammaticam.
and the version at Bestiaria Latina has:
A certain archbishop then rose to his feet and declared, Caesar non supra grammaticos, "Caesar is not superior to the grammarians." Consequently, the word schisma remains neuter in gender.
but these sound to me like embroidering. In his History of Friedrich II of Prussia, Thomas Carlyle recounts Menzel's version, adding adverbs like "mildly" and "loftily", no doubt contributing to the story's use as an object lesson in the arrogance of kings. Many sources wrongly attribute the origin of the proverb Caesar non supra grammaticos to this anecdote. Note, though, that Rex Romanus is correct, since in 1414 Sigismund was king of the Romans but not yet Holy Roman Emperor.
*Menzel's version also has the Cardinal say neutrius rather than neutri.