Remote shell cannot connect to node

I have a cluster of several nodes running the latest version of Elixir/Erlang.

/app/erts-14.1.1/bin/beam.smp -Muacul 0 -hms 29824 -sub true -swt very_low -sbwt very_long -S 10:10 -- -root /app -bindir /app/erts-14.1.1/bin -progname erl -- -home /app -- -noshell -s elixir start_cli -elixir config_provider_reboot_mode embedded -setcookie "*********" -name node-0 -config /app/tmp/config-20231215052942-5788.runtime -boot /app/releases/1.2.3/start -boot_var RELEASE_LIB /app/lib -kernel connect_all false -shutdown_time 5000 -- -- -extra --no-halt

For some reason I cannot run a remote shell to connect to one of the nodes. All others can be connected to just fine when executing the remote command using the mix-generated release startup script.

All the nodes are identical, and this remote shell works when connecting to most of the nodes, but fails on a couple. Aside from that the node is functioning fine, and the application does what it’s supposed to do.

If the node is restarted then it seems to fix the issue. But sometimes it happens again.

Any clues on how to troubleshoot it?