your current 27-in iMac ¿what model-year? should not be having problems with RAM at 32 GB.
in general, for the items you mentioned, 32 GB will be fine. what drive are you using?
You are likely running other stuff that is killing your performance.
By far the easiest way to cause instability and crashing is to install ANY third-party speeder-uppers, Cleaners, Optimizers, or Virus scanners. or a VPN that you installed yourself.
The idea that a third party, with no special knowledge of the inner workings of MacOS, can somehow find a simple way to protect your computer — that is not already being done by MacOS itself — suggests that the MacOS developers are somehow "holding out on you". That is absurd.
You should remove any and all (other than Apple built-in) virus scanners, speeder uppers, optimizers, cleaners, App deleters or VPN packages you installed yourself, or anything of that ilk.
Third-party file Sync-ers such as DropBox, BackBlaze, OneDrive, or GoogleDrive can also ruin performance, but are not inherently dangerous.