Accepting An Unintended Worldly Benefit For Worship
Your understanding in the first paragraph is correct. And the example quoted above is not Shirk in any way, infact it is an attitude of ihsan as required in religion where we go overboard in fulfilling certain familial/social responsibilities or favours which the person did for his friend in the above example. On a side note : It must be kept in mind that commitment of Rayakari is not outright equal to shirk. It is a polytheistic attitude, which means a reflection of polytheism can be seen in this act and will earn him sin and continuity of such act may take it to the level of polytheism, but it is not equal to Shirk in belief which is one of the biggest sins.