Like I mentioned before, Sonic has taken L's before. In the context of fights or vs battles, it's possible for him to lose, but he'd win at the end of the day. I'd liken it to...aight, so Ichigo doesn't have fate hax on his profile right? But Yhwach stated that Ichigo has always had the ability to change fate and had been passively using it through most of his battles, and was even using it against Yhwach. Let's pretend that Ichigo actually does have that ability. It would work similar to Sonic.
Yhwach basically hax stomped Ichigo with the Almighty, broke his bankai, stole his powers, and left him for dead, along with the fact that he had the ability to see all possible futures, choose which one he wants to happen, directly do things in the future that affect the present, has insane pre-cog + power null and reactive evolution on top of tons of other abilities. He beat Ichigo in their initial fight, but when Ichigo got his Bankai repaired and went to fight him again, the perfect circumstances aligned so that Uryu, the one hard counter to Yhwach's Almighty, Aizen, the one who placed a potent perception manipulation hax on Yhwach before he activated the Almighty, and Ichigo, the one with the raw power to put Yhwach down, all were in the same place at the same time and played the perfect outcome that allowed them to actually defeat and kill Yhwach. They essentially created a future that he couldn't foresee and defeated him despite all the odds being against them.
Sonic is similar in the fact that he could take L's, but at the end of the day, he would win the overall battle. So, in the context of a vs battle, similar to how Ichigo lost to Yhwach in round 1, Sonic can actually be incapped and or lose fights. In the context of a VS Battle, it's possible for him to 'lose' the fight without losing the overall battle or dying, since there is no overall battle.
And to see how the SK can incap Sonic, we'd have to compare their textbooks of abilities and resistances and determine how potent their haxes are