Bugs are an indication of issues with some part of a software system. It is much cheaper in most cases to keep fixing bugs. However, in case there are some missing features altogether or there are things which cannot be done because of the system architecture does not allow it, the dreaded rewrite may be called for.
A tiger team usually gets assembled to redesign and rewrite the whole system. This is one of the main reasons to have a good detailed design with a long-term perspective from the get-go and to ensure that clean coding practices are followed.