The error code 22 on The Sims 4 occurs when you try to save a game. When triggered, you will get the following error message with this error code:
The game failed to Save. Please exit to the Main Menu and then select Play to reload the game. Error code: 22.