Docker desktop on macos testcontainers

I have been trying multiple forums, no luck with help so far.
My team develops a java application and for testing we use testcontainers. Everything was working fine till version 4.40, newer versions no longer work for our use case.
The problem is with using Keycloak with testcontainers inside docker desktop on macos. Keycloak internally checks if it is running on localhost and then allows http protocol. After version 4.40, it no longer detects as being on localhost and no longer permits http on our local testing setups. We are stuck on version 4.40 till we can find a reliable solution.
Inspecting the containers at version 4.40 and later the only difference I can see is within port mappings (see below). Not knowing the inner workings too well, is this the cause and how can I fix this?

On 4.40

"PortBindings": {
            "8080/tcp": [
                {
                    "HostIp": "0.0.0.0",
                    "HostPort": "0"
                }
            ],
            "8443/tcp": [
                {
                    "HostIp": "0.0.0.0",
                    "HostPort": "0"
                }
            ]
        }
"Ports": {
            "8080/tcp": [
                {
                    "HostIp": "0.0.0.0",
                    "HostPort": "61426"
                }
            ],
            "8443/tcp": [
                {
                    "HostIp": "0.0.0.0",
                    "HostPort": "61427"
                }
            ]
        }

On 4.48

"PortBindings": {
            "8080/tcp": [
                {
                    "HostIp": "",
                    "HostPort": ""
                }
            ],
            "8443/tcp": [
                {
                    "HostIp": "",
                    "HostPort": ""
                }
            ]
        }
"Ports": {
            "8080/tcp": [
                {
                    "HostIp": "0.0.0.0",
                    "HostPort": "62663"
                },
                {
                    "HostIp": "::",
                    "HostPort": "62663"
                }
            ],
            "8443/tcp": [
                {
                    "HostIp": "0.0.0.0",
                    "HostPort": "62662"
                },
                {
                    "HostIp": "::",
                    "HostPort": "62662"
                }
            ]
        }