It depends where one does this. In the UK, I believe it is a crime to falsely claim to be the monarch. Lady Jane Grey was beheaded for doing so. The charge was treason.
In any other places it is probably not a crime, but might be viewed as evidence of insanity.
A comment mentioned Emperor Norton who lived from 1818 to 1880, largely in the US city of San Francisco. He proclaimed himself "Emperor of the United States". He was treated as a piece of "local color", not as a criminal. According to the Wikipedia article on him (linked above):
Norton had no formal political power; nevertheless, he was treated deferentially in San Francisco, and currency issued in his name was honored in the establishments that he frequented. Some considered him insane or eccentric, but citizens of San Francisco celebrated his imperial presence and his proclamations, such as his order that the United States Congress be dissolved by force and his numerous decrees calling for the construction of a bridge and tunnel crossing San Francisco Bay to connect San Francisco with Oakland. Though Norton received many favors from the city, merchants also capitalized on his notoriety by selling souvenirs bearing his name.