If the opponent is lower than your rank and he’s able to raid you, also if he does 20%, you can lose trophies because depends also on your towers, units, levels.
For example: If you are around 3,000 trophies with disgusting towers, units as defence, buf your opponents (that maybe has 2,500 trophies) win against you with also around 20%, you can lose trophies because the matchmaking calculates that you (that you should be more strong than him) are not enough powerful with your defence, so give privileges at your opponenets that has been more able to raid you.
This thing happens already at me, also if the opponents do 37% i lose maybe around -5, -10 trophies =)
Never happen that when you try to attack a player with high trophies but you are under the threshold of success against his base, but maybe you did at the end around 50% and maybe +5 trophies ? In his chronology he will see +50% and -5 trophies
So happen the same thing with you