Ah I didn't check to see that /var/vm is on that swap partition. I thought :-
1) the swap partition was separate.
2) sleepimage was only when the iMac goes to sleep and keeps an image of where it's at
OK this makes more sense why it can't grow anymore, it's cos the swap partition has maxed out. I kept expecting more swap files to be dumped into that directory growing as needed.
Yes PixInsight is an astro processing software and I usually dump into it anything from 90 to 220x 122MB raw files for processing. It in turn creates other temp files (but that's ok 'cos I've configured the app to use space in my 32TB external disk for that, plenty of space there).
It's during calculations and processing is where the PixInsight starts to bloat and is consuming memory. I'm not certain if there's a way for me to try to grow that swap partition as I do have space in my root disk.
The 'swap' volume (VM) is separate from the system volume (notice I use the word 'volume'), but they are both in the same APFS container. The VM will grow further if the system needs it and there is space on the boot/system disk. Do check your free space on the system disk. You can see the VM volume in Disk Utility (with View -> Show All Devices enabled) inside what is probably called Container disk1. Select Container 1 to see all the volumes inside. What you see in /var/vm is just a representation of the content of the VM volume.
The name sleepimage is a bit of a misnomer. But so is swapfile - it is really a pagefile which in the old days was quite distinct from the swapfile.
Your astrophotography is out of my league. Very occasional, up to about 50 (at most) 30 MB raws for which I use Deep Sky Stacker. PI is much more sophisticated!
But I fear you may be at the limit of what you can do with PI and only 64GB RAM. Closing as many other apps as possible will help a bit.