According to at least on Vlog I watched, Colt made a few bad decisions that led to their situation:
1. They were seeing a huge rise in demand for their revolvers, partially due to so many first-time gun buyers being more comfortable operating one versus a semi-auto. So, they decided to retool their factories that were making AR's to make more revolvers.
2. The remaining AR production lines were used to service the government contracts. The gov't not only buys military M4 rifles, but they also buy AR-15s for non-military agencies.
3. They had a harder time competing with other civilian AR makers. Colt rifles are no longer in a class by themselves, but the pricing is still higher than most competitors with similar quality ARs. The decision to continue charging a premium for the Colt name meant a less competitive position in the civilian market.
4. The decision to completely withdraw from the civilian AR market could not have come at a more inopportune time. 2020 saw a massive spike in gun sales, including the AR-15. The election being won* by Biden meant an assault weapons ban may be on the horizon. The huge uptick in first time buyers and in just demand across the board would have driven Colt's revenues through the rood had they produced enough rifles to take advantage of it.
5. Their messaging to the public as to why they were shutting down their civilian sales of ARs wasn't handled well. It came across as virtue signaling or acquiescence to gun control pressures, with a manufactured excuse that they needed to focus on gov't contracts. Had they explained their market strategy, and how the introduction of the new Colt Python reboot fit into that decision, maybe the public would have better understood. As it happened, most things I saw accused the company of caving to the "get those assault weapons off our streets!" crowd.
Basically, bad timing, poor PR and their short-term business vision is what caused the company to make bad decisions. Of course, hindsight is 2020.