It's not breathing compressed air that causes the problem, but rather that the gasses in your lungs are pressurized at all + rapidly lowering pressure on your entire body on ascent.
In freediving, the air in your lungs is still pressurized equally at depth to what it would be with scuba, so the same thing happens.
In scuba, you do replace the amount of problematic gas in your lungs as you breathe, which potentially leads to higher body saturation (as you're not just exhausting what's in one single lungful). But that's more about gas interchange at all than pressure.
If you spend long enough at depth, even without breathing, you run into the same problem.