I have a ford mondeo that had broken down. I called AA and they ran it through their computer and it said fuel sensor problem. I went to a?

Garage and they replaced the fuel sensor. I drove up the street and the car broke down again. Plugged it in at the garage and it said fuel sensor fault. The garage then took that fuel sensor out and put it back in the car it was from and it was working. What could be the problem?

Seems like a bad connection got tightened up.