At other projects, I was hired to add some external expertise to an existing team. But it's mostly long projects in teams.
But before I ended up in these sort of big projects, I went to a lot of local meetups to keep in touch with other freelancers. That can also be a great source of a network, although that never amounted to much for me.
> "Lots of other small startups contacting me all the time trying to convince me to do a lateral move, but what's the point, I will just be the only in-house dev, stuck and stagnant again."
It can be a great way to prove to the companies you actually want to get hired by, that you can work in a company as part of a team.