Note —> the topic is sola fide alone. No aspersions raised on Luther, Calvin etc as persons, that’s not relevant.
Dispensational understanding will clarify those passages.
“Systematic Theology” by LS Chafer is a good place to see this explained in detail. Also, see “Reign of the Servant Kings” by Joseph Dillow and also “Once Saved Always Saved” by RT Kendall.
Sola fide (by faith alone) is scriptural.
As yourself this, could a man on his deathbed repent and be saved? If so, it’s too late for him to do good works, so he must be justified by faith alone.