Many actors on Law & Order played one character and then came back as another, notably Jerry Orbach as a defense attorney and then later as Lennie Briscoe. Michael Imperioli was a murderer in one episode and a temporary regular (Nick Falco) when Jesse L. Martin dropped out to star in RENT.
These characters were regulars on the show who were replaced, but came back once or twice, either as defense counsel or a suspect:
Carolyn McCormick (Dr Olivet)
Richard Brooks (Paul Robinette)
Carey Lowell ((Jamie Ross)
Michael Imperioli (Nick Falco)
John Fiore (Tony Profaci)
Vincent D’Onofrio dropped out of L&O Criminal Intent intending to do other things, but came back for the final season after Jeff Goldblum left the series.
She never really “left” per se until the very last season, the role was always hers when she was available and Chalke was basically her “understudy” who filled in on a week-to-week basis if Goranson was at school during filming. Possibly a unique situation in TV history.
Geoffrey Hughes’ role as “loveable rogue” Vernon Scripps on Heartbeat overlapped with that of Gwen Taylor’s Peggy Armstrong, but he eventually left the series in Season 14 by faking his own death to avoid the taxman. In Season 16, he returned briefly to claim his share of an “inheritance” after hiding in Spain for more than a year.
Denise Crosby played Tasha Yar on Star Trek: the Next Generation, left (and her character was killed off), came back for one episode as Yar in a time travel episode, then later for as her half-Romulan daughter. Also appeared as Yar in the final episode.
There was Tommy Chong, who didn’t exactly "leave* That 70s Show, as such, but who had a sort of involutary absence to serve a prison sentence. And after that he came back to the show.
Reminder that I’m not looking for actors who come back in one-off appearances. I’m looking for actors that were part of the regular cast, left the show, then came back as part of the regular cast again.
Also, if I can add to my OP – who was away longest before coming back?
Caitlin Brown as Na’Toth. Replaced by Mary Kay Adams in Season 2, disappeared for Seasons 3 and 4, returned for season 5.
There were several actors who were able and willing to endure long hours in elaborate prosthenic make-up, and were cast as multiple characters over the course of the series. They were unofficially known as" the Babylon 5 Alien Rep Group." Wayne Alexander and Kim Strauss were the most notable.
I know the OP said no guest roles, but I think Buffy the Vampire Slayer and Angel were noteworthy for keeping the same actor in a role, even after long absences.
There is that one case where an actor played a main character, the character left, never to return, then returned as another character…in the same episode.
Another one in the Law and Order world… Kelli Giddish was a main cast member in SVU for several seasons. then was guest/one-off for a couple seasons and is now back as a main cast member.
Remember Martin Ferrero in Miami Vice? In I think first episode he played hitman killed by Johnson, then some episodes later he played Izzy in recurring role
Mike Evans played Lionel Jefferson on both All in the Family and season 1 of The Jeffersons. He was replaced by Damon Evans (no relation) in seasons 2-4. The character disappeared completely in season 5, then Mike Evans returned as Lionel for the rest of the series.
In another Norman Lear production, Esther Rolle quit her role in Good Times after Season 4, but returned for season 6.
Would you be talking about Nichols, where James Garner played a sheriff who was killed at the beginning of the episode,and returned as the sheriff’s twin brother after the funeral?