While you can't permanently delete messages on your PS4, you can use the "Leave" command in the Options menu to remove messages from your screen.
There are several ways to determine whether you can get rid of a PS5's Wi-Fi network error message or if it's a hardware issue that Sony needs to fix.