Making a group from a single node that has some connections will add the
connected outputs and inputs first, then add all unconnected outputs and
inputs. This can lead to incorrect socket order (out-in-out-in).
This patch integrates unconnected sockets into the main outputs/inputs
loops to ensure all outputs are added before inputs.