The first line repeats, word for word in Hebrew, the second half of 14:31.
Quick answer
Mockery of a poor person is an insult aimed past them at God. The verse routes it upward, exactly as 14:31 did.
Read both lines
The Hebrew phrase "reproaches his Maker" is identical to the one at 14:31, where the offense was oppressing the poor. Here it is only mocking, and the consequence is the same, which is the point worth catching: the book does not require an act of exploitation before God takes it personally. Contempt is enough. The second line widens it from the poor to anyone in trouble, and gladness at another person's calamity is treated as its own offense rather than as a mere lapse in taste. Both halves assume the same thing, that people are not raw material for anyone's amusement.
Related: Proverbs 14:31 · Proverbs 24:17–18 · Proverbs 22:2 · Matthew 25:40
New King James Version®, Copyright © 1982, Thomas Nelson. All rights reserved. Full copyright information. Scripture provided by API.Bible.
Go Deeper
If this verse has been used to put weight on you that it was never carrying, ask about it directly.