When was she supposed to retire? Republicans didn't even hold a vote for Merrick Garland under Obama's presidency, so if your answer was during that term, then there'd be no chance she would have been replaced, and she'd be blamed for retiring too early.
Blaming Ginsburg for Republican fuckery is misguided and can only be justified with the benefit of hindsight, which she didn't have at the time.