There can be a lot more that's going on than just they are bad programmers:
- They are solving a fundamentally hard problem: it's a problem that at first glance looks easy, but turns out to be really really hard (for example: http://en.wikipedia.org/wiki/Travelling_salesman_problem)
- They are under-resourced and/or over-committed: they know how to fix your problem, they just don't have time to do it.
- Your not paying them enough to make it worth fixing: similar to the above, but in this case you simply don't represent enough revenue to make the doing the fix cost effective. Especially if it's a problem only you have.
- They have architecture constraints that make it hard to fix the problem: a bad/simple/incorrect design may make fixing the problem very hard
- They have legacy code which was poorly written or simply coded very fast and is now brittle and difficult to fix.
- They have internal political problems which are preventing them from fixing the problem.
I'm sure there are more that others here on HN have seen.
The worse case I saw of this was with a contractor who underestimated how hard the problem was, under-resourced the project and the resources that where on the project where not very good engineers. That project crashed and burned so hard there were lawsuits.