I'm not entirely sure how this ever worked before, probably only by accident.
The issue was that ntree_shader_expand_socket_default added a new link, but did not remove the existing muted link to the socket. So it was essentially luck if later the muted or non-muted link would be considered.
The solution is to just remove all muted links in a preprocessing step.