That is true but in outer space, with no sun to heat it, that wouldn’t be enough to keep the atmosphere from freezing.
On a planet larger than Earth the combination of heat from internal nuclear processes such as fission and gravitational pressure could very well be sufficient to keep a planet warm enough to maintain a non-solid atmosphere. After all, stellar objects, from the Sun down to brown dwarfs, manage to maintain an atmosphere even though they're in the cold depths of space without a larger star to keep them heated. And the mass of interstellar bodies is more of a continuum with a not-so-bright-line division between planets and stars (bodies formed by accretion and bodies formed by collapse of interstellar gas). Further, theory discusses so-called "
cold gas giants" which can radiate more heat than they receive from their host stars.
It is therefore not outside the realm of possibility for there to be bodies in interstellar space that are not "stars" properly speaking but which do generate sufficient internal heat to maintain a gaseous atmosphere.