Rule of thumb in finance. When a system that looks stable assuming rational actors has a history of going haywire, the answer is usually leverage.
Devaluations spin out of control because of foreign-currency borrowing. Dollar debtors paid in yuan become forced sellers of assets and yuan amidst devaluation. (Their interest payments, in yuan, go up. Their revenues, in yuan, do not.) This panicked selling further devalues the currency, which leads to more panicked selling. This is a currency crisis.
When a government communicates FX boundaries, borrowers see a risk limit. They might hedge against currency moves up to that limit. Or keep enough dollars on hand (via cash or credit lines) to absorb pain up to that limit. Either way, when that limit is breached, they bleed. This feedback mechanism is commonly known, which turns breached limits into a self-fulfilling prophecy.
Confidence is tricky.
7 was considered a line in the sand that the government wouldn’t cross. Now that they crossed it, no one knows where the line in the sand is.
Chinese could also convert $50k a year for their own needs without having to justify it. (Foreigners could convert however much they made), so the controls were pretty reasonable at that time, not sure how it is now.