King Canute of course had more sense than to believe he could hold back the tide. He did it to show his courtiers the limits ...
A theme that recurs in folk tales is the foolish ruler, the king who becomes so besotted with his status and power that he thinks he can do anything he wants.