(1) This was a special election. Special elections in California generally turn out older voters that are much more likely to vote consistently in elections, special or general.
(2) Turnout was far lower than a general election turnout, considering most of the voting was done by mail.
(3) Mike Garcia had the advantage of running in the shadows of a political scandal that indeed resulted in Katie Hill being victimized, but nevertheless, the fact she had an extramarital affair ultimately embarrassed voters down there (and he did make it a campaign issue).
(4) Before Katie Hill won the district in 2018, it was a reliably Republican district for 26 years. In fact, when Clinton won the district in 2016, its GOP representative was actually re-elected (Steve Knight).
(5) The two candidates in this special election, Garcia and California state assemblywoman Christy Smith will do it over again in November. This was basically a rent-a-seat election.