Having been on the permanent-staff team dealing with contract workers, I can't see permanent staff ever being replaced by "gig" developers. A lot of things depend on having not just skill in programming but familiarity with the business and prior decisions about the system's design and architecture. You can hire short-term people for specific tasks, but you need people who've been there long-term to work out how to fit new requirements into the system as it exists. Then there's maintenance. Bugs that make it into production tend to be obscure and hard to trace, and someone new who isn't intimately familiar with how things fit together's going to be completely lost trying to troubleshoot a bug that's not in any component but in the interaction between 3 different components (or worse, a bug caused by all 3 components being absolutely correct and bug-free but that particular account's so old it has a combination of settings on it that isn't currently legal and that the documentation doesn't mention).
The permanent staff won't be the cheapest in absolute terms, but they'll be the cheapest in terms of dollars spent for results produced. This isn't a guess, it's a prediction based on the outcome of the vast majority of attempts to replace permanent development teams with contract workers and consulting firms.