Yes, and the path you read about is the most common one. Most successful freelancers I know did 2 to 4 years employed first, and the contacts were only half the value. The other half was learning what good looks like, code review, deployment, estimating work, talking to stakeholders. Clients pay self employed developers for judgment, not just code, and judgment is what a job teaches.
Two cautions from watching friends make the jump. Check your employment contract before taking side work, non compete and client poaching clauses are common and enforceable in some places. And your first clients usually come from people who already saw you deliver, a former employer becoming your first client is the classic safe start. The plan that works is get the job, be visibly reliable for two or three years, keep relationships warm, then start with one small contract while still employed if your contract allows it. Going independent is a sales and trust problem more than a coding problem.