As a generalist you risk never getting anything off the ground, and being useless to people hiring because what they want is the specialist.
As a specialist you risk your specialization becoming obsolete, leaving you with nothing. You also risk picking an oversaturated specialization, or one that leaves you in a dead end role that pays less and less over time.
I think the job market for software developers is so much different now than it was, say, 8 years ago, that I'd probably advocate for becoming a specialist over a generalist. Getting your first job and making those initial connections will help you immensely in your career. But it's a tough call, both paths are very difficult and either way can work out if you're very persistent. And whichever path you choose is more likely to introduce you to like-minded people
It's a fun style of advice-giving
Yeah this is the part I’m stuck at. You can’t just “establish your career in something you’re passionate about”, lucrative or not.
Let’s say in a run of the mill enterprise web developer, but I have an interest in a particular niche, say low level network programming or game development. I can hone my skills in the latter all I want, but I’ll never get the chance use them at my day job and I’ll never get a job working in that nice because they’re only interested in already established professional experts.