In my experience it's rarely a technical challenges that negatively impact project timelines. Usually it's changes and revisions coming from the client side (though all parties can and should submit changes). The randomness (and hence risk) in a project doesn't come from the initial scope agreed upon. It comes from the fact that people are dynamic, and the act of building software is dynamic. A feature that appears complete at origin will almost always accrue changes, tweaks, and revisions.
These dynamics are difficult to map to a fixed cost project.
Additionally, as a worker, you are always measured by hourly rate, whether or not you charge by the hour. A $5000 project that takes 500 hours to complete values developer time at $10/hr. If you can get the job done in 50 hours, the labor is worth $100/hr. Your technical acumen is not the sole determinant of this time variance, instead it depends on the behavior and temperament of all the project stakeholders.