Great stuff and hopefully it was just a loose connection.
If it happens again in the future then just unplug one of the switches, clear the code and reconnect, then take for a quick drive and re-scan, at least then it should hopefully narrow down the suspect.
In respect of the TPS, difficult...