I'm not from Sweden but I'd expect homelessness there to be almost never caused purely by financial difficulties or unemployment. The vast majority of homelessness in the Nordic countries is either due to mental health or substance abuse problems, or a combination of financial difficulties and other compounding factors such as those.
GP probably meant it's almost impossible to become homeless in Sweden because of a lack of a social safety net alone.
And one bit of Swedish society that is a bit invisible to the outside: it has an extremely draconian approach to drug abuse. Even though it's a Nordic country and touted for being socially progressive, drug policy here is extremely regressive when compared to Portugal or the Netherlands.
So usually the homeless I see in Stockholm are addicts (alcohol, heroin, amphetamines) that fall through the cracks of the system as they won't stop abusing substances which Swedish policies have no way around to help them, it's extremely punitive for drug use, as even use is a criminal offence. In the case you are taken in custody by the police they may force a drug test and if detected you'll be punished.
This all compounds to leave a marginalised population that has inadequate support to fight their addictions (usually caused by mental health issues) and kept in limbo between the streets and courts to be ordered to get clean.
GP probably meant it's almost impossible to become homeless in Sweden because of a lack of a social safety net alone.