With CONFIG_POSIX_API enabled close() does not do cleanup properly for all allocated resources. This results in sockets not being closed properly, which can be verified by running the shell command 'net sockets'
Originally reported and fix proposal found here #79357 but alternate fix proposal was used instead here #80232