2006 Nissan Pathfinder SE Sport Utility

Allright before I spend the money on the brand name parts . How come the mechanics diddnt wanna work on it I know they got the codes cuz they had it printed on the receipt it also said they cleared the codes to see if they would come back which they did after we left the first one was alrdy closed and the second one told us it was something to do with our computer and told us to take it to a Nissan dealership which I know dealerships charge a lot of money. Like why couldn’t the mechanics just read the codes and change the sensors? I paid both mechanics pretty much $100 each to tell me nothings wrong with it putting my hopes up for a sec than my car shuts off while driving down the road .