Hello and welcome to the forum.
I have had experience of this happening before on an Espace of the same age,and it sounds like a similar scenario...
It was one we had sold,and it came back with the customer complaining that it was cutting out.The
temperature sensor was found to be faulty(it was stuck at one resistance/tempoertaure),and it was duly replaced with a new(aftermarket) switch.
The bl##dy thing still wouldn't run right,so we went through the whole system and checked everything.After hours of head scratching and shouting at it,eventually through sheer desperation,I did a resistance check across the new switch as it was warming up.I can't remember which way the switch worked,but it working backwards(i.e the resistance was getting higher as it warmed up,and it should have been dropping,or vice versa,I can't remember!!).Another new switch was fitted,and hey presto,it ran spot on.......The
thought the car was running hot,when in fact it was cold,and vice versa.
Was the car running OK when you took it to the garage,or was it playing up,hence the leads,plugs and cap???(Edit;just re-read your post,and it was fine!Sorry...