I have had the similar issue over the years. The path length described by the length of the loop in the sketch used to create the chain pattern has errors in the way it is used. when the path is around a sprocket it is the pitch diameter of the sprocket that is used. The length of the arc between the pitch points is longer than the actual pitch of the chain. This has the effect of making the chain loop have the gap shown.
This shows a 6 tooth sprocket with a pitch diameter of 12". the error in this case is .2832" every tooth.
I have needed to shorten my chain paths (in the sketch) based on this error when creating chain patterns.
On a separate but related note I am struggling to find a way to simulate chordal rise when the chain engages with the sprockets.
We attach slats to chains a lot in the conveyors we make and it would be nice to see chordal rise. It matters when big chains like the one shown above are used.
It cannot account for slack in the chain. It is expected. Just add an extra instance and ignore the misalignment,