Starting in 1962’s Dr. No, and continuing straight through to 1979’s Moonraker, Lee saw both Sean Connery and Roger Moore’s Bond stroll into his office for orders.
The longest recurring actor was the original M played by Bernard Lee; who played the character for the first eleven 007 films.
More importantly, the world of James Bond has seen roles such as M, Q, and Moneypenny keep actors at their posts for quite some time, even when the face playing James Bond has changed.
Though the more applicable precedent would probably be that of Dame Judi Dench, whose casting survived the decision to reboot the James Bond series with 2006’s Casino Royale.