The blunt truth is that you were fired because your skill level wasn’t what the company needed. If I can offer some friendly takes on the advice given above, it’s what I was taught about shame and guilt, things with which I struggle. Shame is feeling bad about who you are. Guilt is feeling bad about what you have done. You deserve to feel neither.
You are an awesome, self-driven, credible programmer. You got through a hiring process that is paved with rejection. No reason for shame.
You didn’t hire you. You applied for a job. There is no guilt in that. You didn’t lie about what you could do, the hiring authority at that company made an error and corrected it. I doubt they feel guilty, because they did the right thing, too. No reason for anyone to feel guilty.
Your skill set is a subset of what you, that same self-driven person I see, will be able to do with more time. The only thing that can stop that from being true is thinking that growth isn’t possible. You have grown up to this point, and as long as you realize the control loop governing your empowerment program hasn’t broken, you will continue to iterate through greater potential. Skills++.