However rescuing a startup/project is good as a contractor. Did it more than once and it is rewarding in both experience and money.
Usually, if I'm working directly for the company, it is great. They understand the previous team failed and they want to move forward. It might be a little tough to ultimately gain their trust, but confidence goes a long way.
If I'm working as a subcontractor for the contractor/team that failed, it won't be fun (in my experience). They are not grateful, they are going to blow budget (their problem, but they make it yours) and they will blame you when the time comes for it. Also, they take forever to pay.