On some machines (including mine) the key doesn't shut it off. Diesels don't have ignitions so if no electric fuel pump or electric injectors or shut down solenoid you use the throttle to turn it off.
:welcome: to TBN
Was the switch OEM or generic?
Generic might not be exactly the same connections, (but 'almost')
The shutoff solenoid would be a normally closed wanting a switched power connection.