Distorted audio when resampling

When I change the sample rate through the processing audio option, the audio starts to sound really distorted, like it is coming out through a broken speaker. It seems that the problem is only when I change the sample rate inside Cubase, even if it is a really small change, like %0,1.
Here is the audio I exported where this problem is showing. Stream RESAMPLE by Franco Tavis | Listen online for free on SoundCloud

I tried installing the latest drivers on my pc and audio interface (Focusrite 2i2) but nothing seems to work.
Any help is appreciated