There are even more cases where people use them as shoes in the hospital, because hospital socks generally come with non-slip material on the bottom, so people can walk around the room in the socks in a very safe manner. (More often than not it is the swelling of the feet that makes it impossible to wear everyday shoes.) So generally speaking, hospital socks are very elastic because they necessarily take into account these special needs.
But being stretchy doesn't mean that these socks are comfortable. The first thing is that many hospital socks don't stretch evenly. The elastic part of most socks is concentrated only in the band part at the top of the sock, and while these bands have good elasticity, they are also too strong in their contraction. These bands can easily cut into the skin, especially swollen skin, and in not too long a time they can leave a deep dent in the ankle or calf, and even affect blood circulation directly.
The elasticity of high quality hospital socks is distributed in every part of the sock, especially in the barrel part, they are very elastic, but very gentle, especially reflected in the contracted state of the sock, they do not tighten the sock very much, but very restrained, just just just close to the skin. Also high quality hospital socks have a wide band section at the top of the sock, with a maximum longitudinal width of over 3 inches, which makes them virtually unbinding and compressive on the ankle or calf, they don't cut into the skin and don't even leave any marks.

High quality hospital socks don't sacrifice comfort for special purposes, in contrast they are as warm as high quality cotton socks but more flexible than cotton socks, in fact even if you have a swollen ankle, wearing these socks is no different than wearing regular cotton socks normally except for the stable grip.