An Error12 is an out of resources condition. Usually it means that the game's RAM usage has spiked above the danger zone of ~3.5 GB, even for a brief moment, and the memory registers (RAM only) are polluted with unusable garbage so a save cannot be completed. It can also happen during/after very long CAS or Edit Town sessions where many changes were made and the game runs out of usable resources of other kinds along the way. There are often enough no ways to recover from that within the current session.
What one would want to do if these are happening constantly on each game session is use Task Manager to check the game's RAM usage on startup, when the game clock begins moving forward smoothly, then again frequently throughout play. If the RAM usage is not leveling off at a safe point, well below 3 GB for most worlds, the eventual Error12 is inevitable. If one's session is running at or above around 3.3 GB, experiences will vary but the Save or Save As process itself will cause a temporary spike in RAM usage and can also lead to the same error.
TS3 is a 32-bit application only and cannot use more than 3.7 GB of RAM or recover from more than that trying to be used under any conditions even if the player's system has more RAM than that available.