Lightly poking fun at oneself in order to “break the ice” or otherwise relax a conversation or audience, or to reflect true humility is one thing.
Self-insulting, which lowers one’s stature in his own eyes as well as others, can cause a person to not try as hard to reach their potential, or it may reflect low self-esteem.
A Rav joking with a person who forgot to bring his sefer to the shiur by saying that he would be likely to do the same thing is poking fun at himself in order to make the student feel better.
A student saying to himself, “I’m stupid and not cut out for this anyway, so why study?” is selling himself short.