This is a common risk when you have an extremely progressive tax system, or rely heavily on taxing companies. Companies and high income people have volatile income, making tax revenues volatile.
If you want to avoid it, you'll need a more regressive tax system that leans heavily on the poor/middle class (e.g., the sort you find in Europe).