here are two sentences:

1. The boy humiliated his parents by behaving badly in front of the guests.

2. The boy's bad behavior in front of the guests humiliated his parents.

do the two mean all the same? Doesn't the first one suggest that the boy intentionally behaved badly so as to humiliate his parents?
Yes I can see that distinction, but they could also mean the same thing.
As I see the implications in the word order, no.2 suggests that it was the behavior that humiliated the parents, and in no.1 that it was the boy. I don't think the difference lies in the presence or absence of intention.

I believe there is a saying that goes roughly like this: 'Hate the crime, not the criminal.' No.2 puts emphasis on 'the crime', no. 1, 'the criminal'.
Students: We have free audio pronunciation exercises.
It means the same though the emphasis is different.

in 1) the action is the boy humiliating the parents

in 2) the action is the boy's bad behaviour.

Hopw this helps.
Students: Are you brave enough to let our tutors analyse your pronunciation?