If your driver mode in SONAR is WASAPI or WDM and you're seeing both Focusrite and soundcard I/O ports in Audio Devices, you may have a conflict between Playback and Record Timing Masters that's causing distortion. Or possibly you have input echo enabled on the track that's recording Stereo mix, and you're getting a feedback loop because 'Stereo Mix' is the output of the soundcard, and you're echoing the output back to the input.
I recommend you set the Driver Mode in CbB to ASIO so it sees only the Focusrite I/O, and letting Windows and multimedia apps use the soundcard to prevent conflicts. Then, if you need to record output of the soundcard into SONAR, do it via patch cable from the output of the soundcard to input of the Focusrite or use some generic multimedia app to make the recording from Stereo Mix, independent of CbB.