I used a Mindprint Diport with a similar setup som years ago - spdif out to dac in Diport and spdif input from it as well.
Things to look out for is which is master and slave in the connection - soundcard settings.
And if 44k or 48k.
And also if this unit is turned on or not will affect how soundcard sync it all.
Then Sonar has a sync setting for record and playback - which input clock is used.
So it's just trying out these what works the best - but focus on soundcard first of all.
And in Sonar if looping back - don't activate Echo monitoring since it may cause feedback issues.
I'm most familiar with RME cards and don't remember how Focusrite handle sync.