Can't restore corrupted compiler on Kubuntu 20.04

At first you should not delete or rename any files which are controlled by APT (and by update-alternatives as the result).

To reinstall FPC packages you have execute the following command:

sudo apt-get install --reinstall fpc fpc-3.0.4 fp-compiler fp-compiler-3.0.4 fpc-source fpc-source-3.0.4 fp-docs fp-docs-3.0.4 fp-ide fp-ide-3.0.4 fp-units-base fp-units-base-3.0.4 fp-units-db fp-units-db-3.0.4 fp-units-fcl fp-units-fcl-3.0.4 fp-units-fv fp-units-fv-3.0.4 fp-units-gfx fp-units-gfx-3.0.4 fp-units-gtk2 fp-units-gtk2-3.0.4 fp-units-math fp-units-math-3.0.4 fp-units-misc fp-units-misc-3.0.4 fp-units-multimedia fp-units-multimedia-3.0.4 fp-units-net fp-units-net-3.0.4 fp-units-rtl fp-units-rtl-3.0.4 fp-utils fp-utils-3.0.4

and for their 32-bit variants use commands below

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install --reinstall fp-units-i386 fp-units-i386-3.0.4

then all folder structures will be fixed.