I have thought so too but ironically that is exactly what has happened in the case of Lewis' death.
His seat vacancy should have triggered a special election but due to the timing it is pointless to begin the process. It can take as long as 6 months and D's risk losing to an R. That puts their committees in jeopardy for the balance of the term.
He gave his vote to a proxy. He should have been the one to be given the duty to vote by proxy for others considering his length of time in office.
Because he died after the primaries , the D's can just name someone they want. If he died before, the people would have to vote for the new person on the ballot.
He was part of Court battles including getting Trump tax records.
He dies right after the Courts stop them from being released but before the deadline to have a candidate? He dies in the nick of time to also escape voters from choosing his replacement