I quit my job a couple years ago and secured several small retainers over a few weeks using my network. My employer at the time generously agreed to be my first client to smooth the transition.
Today I have am managing 8 active retainer clients, and regular 1-2 week audit contracts, while rarely working more than 40 hours a week. Virtually all code I write is open source, or on track to be so soon, and I only work with clients okay with that.
I am making triple my previous salary, and am actually onboarding new team members as a "tier 1" to help me meet demand without overworking myself.
I am a full stack security engineer with 20 years of experience, and most companies can't have access to senior security engineers without paying GAFAM money in the range of $600k+ total comp, which they just can't afford.
Instead I offer most companies start a retainer with my team and I for as little as 10 hours a month and we can be there when they need help with security architecture, important code reviews, risk assessments, conducting interviews, or just to help unblock people in general.
This model is a win for companies that can't yet afford experienced full time security hires in house, and it is a win for me who can be in control of my time and life with higher income, and only have to focus on the most interesting problems of many different companies with minimal exposure to internal politics.
I can't express how much happier I am. Best career choice I ever made. YMMV.