Kernel Panic on login and when mounting for write access (Catalina, Late 2014 iMac)
panic(cpu 0 caller 0xfff...) /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/apfs/apfs-1412.141.1/nx/fusion_mt.c:651 Assertion failed: length

Your filesystem is corrupted (probably from continued operation while full). Because there is not yet any third-party tool for repairing APFS volumes, you need to:

Already have, or make, a backup of your essential files. Continue reading below for details.
Erase the disk and reinstall macOS.

There is, unfortunately, no other way out of this. APFS is wonderful when it works, and a complete clusterfuck when it does not.
If you do not already have all of your essential files backed up, you can attempt to salvage them. In decreasing order of convenience, your options for this are:

Target Disk Mode.
Low-level imaging of the drive while booted into an external (non-Mac) OS.
Physically removing the drive from the computer, which requires separating the LCD from the chassis.

TDM is easiest (assuming you have a second Mac available). However, given the problems you had with merely mounting the drive, this may fail in the same way. There's a slight chance that using a newer macOS (i.e., Big Sur) on your lifeboat Mac could possibly work better than trying Catalina, as there's a chance that it contains a newer APFS driver implementation which could handle corruption more gracefully.
If you do install Big Sur on your lifeboat and are able to mount the iMac's TDM'd drive, copy your most essential files off of it first, then attempt to repair with Disk Utility. Do not, under any circumstance, attempt to delete or modify anything on the drive. Otherwise you risk corrupting it beyond repair.