You can delete the PS4 version without impacting your play. That said many including myself have a 🗝 glitch where anytime you reboot your system or insert the PS4 disc which is still needed to play the PS5 🗝 upgraded version your PS5 will try to install the PS4 version again without asking.
The PS5 upgrade will be a separate download and installation from the PS4 version, and once it's installed, you will 🗝 be able to play the upgraded version of the game on your PS5 without needing the PS4 version.