There was an API change in Blender 3.5, after which connecting virtual
sockets (sockets inside groups not yet matching any output or input)
through scripts resulted in broken links. A link was created, but not
the matching group input or output.
In 81815681d0 a new API `bpy_extras.node_utils.connect_sockets()` was
introduced to handle this case by creating an input or output of the
matching type and name.
The Lazy Connect operator was in this exact situation, and replacing
`links.new()` by `connect_sockets()` fixes the issue.