How deeply should one understand other people's work before building on them?
This depends on the individual case and requires judgment.
On the one hand, understanding the past work completely gives you a better base of understanding going forward.
On the other hand, there are circumstances in which you understand the past work sufficiently to go forward, and you have enough trust in it to know that you won't be embarrassed in future for doing dead end work.
That complete understanding takes time, as you note. It is seldom necessary for a mathematician to recapitulate the entire history of mathematics since, say, Euclid, to do significant work.
For some problems in some (sub) fields, more understanding is needed. In others, less. But there is an old saying &quot;Don't let the perfect be the enemy of the good.&quot; (Usually attributed to Voltaire.)
If you are good enough to recognize problems with lines of thought and you have insight into the underlying structure of the field, then trust your judgement. If you smell a skunk, delve deeper, otherwise, move on. It isn't a perfect defense against error, but.... Voltaire, again.