Is there a word for feeling amused by someone or some people do something ... erroneous or stupid ?
While not entirely restricted to your definition, I'd suggest schadenfreude,
pleasure derived by someone from another person's misfortune
In this case, you have defined the subset of misfortune which is produced by the subject's own actions, although the term also refers to misfortune inflicted without help from the subject.
ridicule which is contemptuous laughter.
mockery emphasises the disdain of such laughter.
(dated) ribbing, demotic from 'rib-tickling,' emphasises the social nature of mockery.
raillery, is exactly the meaning; but seems to me old-fashioned and formal.
1 : good-natured ridicule : banter
However much M-W dresses it up, the banter seems to me derisive, scornful, or sardonic.
www.merriam-webster 'sardonic' disdainfully or skeptically humorous
I will go with smug for your example, in that a not-so-smart person might feel smug in knowing that there are more stupid or clumsy people than them under the sun.
smug: highly self-satisfied M-W
Alternately, how about gloat?
v. to feel or express great, often malicious, pleasure or self-satisfaction
The act of gloating.
A feeling of great, often malicious, pleasure or self-satisfaction. AHD
If the subject of ridicule has no sense of humor or is annoyingly sensitive, they are always going to take things in negative context, no matter whether your perception as an onlooker is that it is simply "Raillery" or "Mockery".
But to me, "Raillery" is the "show" being performed before you, whereas what was asked was the term for the "feeling of amusement derived from the show".
So, Raillery being the "show", I'd say this is a half-complete answer.