I think you've unintentionally explained why your advice-giving worked in that moment, too -- Bob knew you were coming from a place of good faith!
You weren't "just"-ing him -- you knew the intricacies of his situation, and it's a lot easier for someone to take advice to heart if they can trust that you actually know the context.
There was one member of my group who was having a difficult time motivating himself to make a particular change he wanted to make. I had long since learned the dangers of "advice giving", so really just asked why he felt it was so hard to make that change. He definitely had a lot of backstory that could explain his underlying fear.
However, this pattern went on for about 9 months (him complaining about not being able to make this change, the rest of the group offering support). Finally, at one point I said "Bob, I really care about you, but to be honest, you've been complaining about your situation for months now and you aren't actually doing anything to change it. I understand where your fear comes from, but if you're not going to even try to do something different, I don't really want to hear about it anymore."
The next week he came in having made the first step toward his goal. Point being I had a much bigger motivating impact on him once I let him know how he was affecting my feelings (of course, after we had a lot of time to build up trust) than if I had said "just do x, y, z".