Tbh mate I think it's more a combination of being bent over by the Greens who he needed to keep the SNP in power, and him handling being bent over really badly. From what I've read and heard, he wanted to pull out of the 2030 climate target, the Greens didn't. He went to the players in his party and checked he could pull out of the confidence and supply agreement. They gave him the ok, but later when the motion for a vote of no confidence was put forward and he was considering going to Alex Salmond's Alba party to get the 1 vote he needed to stay in power, those same players said no fcking way. At that point it was all over. So in a large part it shows he brought it on himself because of his own naivety or lack of political nous.
Btw both Labour and Tories are steaming head first into this vote of no confidence, but they really could fck themselves over on this

If there's an election in Scotland, the tories would get wiped out and Labour would at best only be able to form a minority goverment themselves. If I'm Kier Starmer the last thing I want is a minority Labour government in Scotland months prior to a UK GE because they'll inherit all the problems in advance and every bit of negative news from across the border will fall on him. Not just that, but Scotland have some advantages like free prescriptions and the child poverty payments we don't have in England - so what do Labour do there? It's a headache Starmer does not need.
Basically everyone from SNP to Greens to Tories to Labour are like fcking turkeys voting for Christmas... bloody stoopid jocks