The fob won't program until the vehicle is happy that the correct key (electronic) is in the ignition. From reading this, it's not. As it won't allow it to start. So not likely to allow a fob to be programmed either.
Five things need to be good before that car will start - the key, the reader, the immobilizer, the ECU and all the wiring in between. Assuming the battery is OK. Anyone of these can and does fail. When any of these parts are replaced it has to be married to the each of other components with a compatible scan tool.
You can not by pass this electronic key by soldering anything - unless it's an EEPROM or something similar.
Nissan did nothing wrong?
Nissan probably coded a key that was not coded to the car. The locksmith probably did not as they could not access the immobizer (car still would not start). You drove the car away from Nissan. The key was now coded. Job done. You just now know it's an intermittent fault.
Needs to go on a decent scan tool with a decent tech and possibly a scope. Just because you take it to Nissan does not mean they are smarter than the grease monkey down the road but on the same note does not mean they are 'chumps' either.
Automotive techs - you get what you pay for. I've spoken to one who was regularly making $800 an hour on labour - Anybody here own a V8 Falcon with long life plugs?
Not the response you wanted. But an honest that's the way it is post. There is unlikely to be a cheap/simple fix. Note - unlikely. Already at a key, a tow and a key code.