It was very valuable to hear of a similar situation. I'm happy to hear that you were able to rescue the deal, albeit paying a heavy price.
It was already a good result for the investor – the last-minute extras demanded weren't a part of any prior negotiated preference, they were just new things extracted in return for not vetoing a deal everyone else wanted.
In the end, everybody is unpredictable. If you don't protect your rights from the start, you'll have problems. Even (especially?) if you're BFFs, everything should be spelled out in advance, including metrics for conceptual terms such as "success", etc.