Yes it's related to the transistor.
You want (Vdd-Vbe)*(transistor gain)/R > LED current.
BE junction is a diode, so 0.7v for Vbe is generally reasonable. At higher currents it will be larger and will be somewhat lower for very small currents.
Transistor gain varies significantly with temp, part variations, and age. Vce(sat), the voltage loss on the transistor when acting as an on/off switch, is lower when the left hand side of that eq is much larger than (like twice) the right hand side.