Have you ever used a VM, such as with VirtualBox?
The OS (Linux distro) that both myself and Rob use is QubesOS--which essentially is a whole virtualization hypervisor. This is great for security, but it's also just really useful for fixing issues like this. In a matter of ~10 seconds, I can launch a brand-new (disposable) VM. That's great for creating a safe/isolated sandbox for testing things out (ie with `apt`) to see if it's going to break your system like you've done with freecad breaking your package manager.
I don't recommend QubesOS for you, but you might want to look into VirtualBox. It might be easier for you to just create a new Ubuntu VM on your machine without the freecad issues blocking you from installing `firejail` than finding a new physical machine to do this with. And, in general, just being able to spin up a new VM for testing something out without breaking your actual machine is a useful tool to have on the belt..