I swapped a class 165 with a 168 but when I got into the game the master key, aws reset, and reverser don't work
Sometimes the train you are swapping requires different numbers or letters after the main number Swap in the game rather than with TS Tools https://steamcommunity.com/sharedfiles/filedetails/?id=380001963
As Peter said, this is likely to be the cause. Some setup information is provided via the train numbering field, which will only be updated when using the editor to swap the player stock - it should be the first choice before LocoSwap or TSTools, as it also will update dispatcher data which external tools cannot do.