I believe Darwin shelved his findings for years specifically because he didn’t want the hassle of picking the fight he ended up picking, and only published when he found out that Wallace was about to do so himself.
Darwin did not “shelf” his findings, in the sense of stopping work. He just spent decades gathering additional mountains of evidence because he was worried that opponents would spring up and he wanted to make sure everything was watertight.
Then despite his overwhelming evidence, exactly what he feared still happened (and still happens today)
I didn't mean to imply he stopped working on it entirely, but he definitely put off publishing as long as he could because he was (reasonably) worried about what would happen afterwards.
Edit: As per Galileo not actually being persecuted because heliocentrism itself was heretical, Slate Star Codex actually addresses this argument somewhat: https://slatestarcodex.com/2017/10/23/kolmogorov-complicity-...