Most writers don't talk about getting fired - at least, not in public. Writers are happy to share war stories with other writers, but announcing you're been booted off a script is like saying you admire the wit and wisdom of Michael Gove: rare, not well-advised, and possibly the sign of a psychotic break on your part.
The reality is most every professional writer will be fired off a gig at some point in their career. It's a rite of passage, if not an enjoyable one. Everyone will tell you not to take it personally, that it happens to all of us, that you simply have to suck it up and move on. That's all true - but doesn't actually help much at the time.
For a writer, getting fired to akin to being dumped by someone you really fancy while you're in the middle of having sex with them. You may've spent weeks, months, even years getting to this. But halfway through, they decide it's over. You're not satisfying them. Seemed like a good idea but you're not doing it the way they'd hoped. Goodbye.
Unsurprisingly, this news is never welcome. Being rejected isn't much fun, but you can comfort yourself with the thought they made a mistake by not picking you. Getting fired is more personal, because it feels like a condemnation of your performance. You couldn't make them happy, and now it's over. Don't call us. Etc, etc, etc.
I've been on both sides of this situation. When I took over as editor of 2000AD, I booted several creators who didn't match my creative vision for the comic. Whether or not I liked them personally was irrelevant, it was simply about the work. So that was some [tiny] comfort when I got booted from a job last year. It wasn't personal.
But your confidence still takes a hit. You question yourself, your ability, your ambitions as a writer - it's only natural. You try to pick yourself, move on, find a new path forward. Slowly but surely, you rediscover your writing mojo. The wound heals over, forms into scar tissue. With time comes distance, and objectivity.
The worst case scenario is getting booted off your very first commission. That has the potential to crush an emerging writer. If the boot comes after that a few successes, at least you know you can make it as a writer - just not on that particular job. Most important thing you can do? Learn from the experience. Onwards!