The PLATFORM_SOCKETSUBSYSTEM macro is defined in SocketSubsystem.h for some platforms, while others add the definition in a Build.cs file (e.g. Sockets_XboxOneGDK.Build.cs). This definition is missing for PS5, which can lead to problems accessing the PS5 socket subsystem if it is not the default socket subsystem.
Verify that Sockets_PS5.Build.cs exists and there are no NDA platforms in SocketSubsystem.h
There's no existing public thread on this issue, so head over to AnswerHub just mention UE-127454 in the post.