Beginer : Transistor NOT gate? (Solved)

Just so you're clear, servo.detach() doesn't cut the power, it just stops the repeat sending of the position pulse. By default, the servo library "reminds" an attach()'d servo where it's supposed to be, every 20ms.

See this line from servo.h:

#define REFRESH_INTERVAL    20000     // minumim time to refresh servos in microseconds

And once it's detach()'d, there's nothing to cause the servo to hold its position, except friction.