Using BJT NPN to drive relay coil sometimes work sometimes not
The series combination of R1 and the 1K base resistor probably does not provide enough base current to put the transistor into saturation.

You should have a "flyback diode" across the relay coil to protect the transistor from high-voltage spikes when the relay is switched off.