You can find links to various macOS installers from this Apple article which also includes optional instructions for creating a bootable macOS USB installer:
How to create a bootable installer for macOS - Apple Support
Make sure macOS Yosemite is completely up to date or the links to the App Store may not work.
If you still cannot access the Catalina installer, then try downloading the macOS 10.11 El Capitan installer instead. This installer is available to download from outside the App Store. Please read the instructions for downloading and extracting the macOS 10.11 El Capitan installer from the link I provided above as there are several steps involved for getting the macOS 10.11 El Capitan installer extracted to the Applications folder (you must run the .pkg app which extracts the real installer to the Applications folder).
I highly recommend you create a bootable macOS USB installer so you have more options in case something goes wrong.
Edit: You may also want to try booting into Safe Mode to see if that helps you to access the App Store. If this works, then it means you have some third party software installed that is interfering with the normal operation of macOS. You may need to begin installing macOS while booted from Safe Mode if this is the case (or from a bootable macOS USB installer).