All progress bars lie https://austinhenley.com/blog/fixprogressbars.html
It's a challenging problem, because either attempts at a solution (being direct, or being indirect) causes a worse user experience due to expectations of linear progress. For example proposed solution 1 in the article would have you create some sort of animation or additional progress bar to let people know if something is actually stalled/dropped vs something just taking more time, you would still be lying to them, but it's for the benefit of user experience.