What are the consequences of sinning?

I read a hadith where Imam Ali said that bad things that happen, like falling over on your face is a consequence of sins.
(paraphrasing to the best of my rememberance).

Does this mean that sins have immediate consequences in this world?

For example a thief steals and ultimately is robbed himself?

Yes, sins have consequences. Some that we notice, others that we don’t notice. However that hadith you mentioned is in fact a reality. The reason is to have us fear sins, so we may return to Allah.

A man told imam Ali i missed praying at night, imam Ali told him it’s because of something you must have done during the day.

Sometimes it’s dua not being answered. Sometimes it is getting hurt.