They mishandled the assassination by the Serbs. Serbia would never agree to the terms(and they didn’t) set for them by their masters, for the death of Ferdinand, and it led to their downfall.
As I understood it years ago, Serbia HAD agreed to the terms - but the mobilizations caused by the alliance systems put things on a crash course anyway. I have no horse in this race, so I’ll concede we may never know the truth (and I could believe either side’s version of events).