Consulting is not the main driver of Red Hat revenue, the main thing Red Hat sells is Support.
Support is something enterprise customers want, and they will sign yearly contracts to get it. In return, if/when they have a production issue, 0-day vulnerability, etc, they have someone to contact (or may have contacted them!) to help them resolve the issue. And Red Hat has experts in both support and engineering, meaning resolution can be anything from a config change to a rapidly released patch. Happy customers renew year after year.
I work for Red Hat Consulting. This is a very different beast, consulting involves selling lots of short to medium term projects with the occasional long project, then trying to optimally staff those projects. You only get revenue while consultants are on the ground. It's not surprising to me that an open source company that relies only on consulting wouldn't be sustainable.