how to avoid getting into scrapes like this in the future?

It seems that your intention was to use your investment as motivation to further your career, i.e. “Once I own a company I will get awesome stuff done”.

I recognize the line of thinking (from being there!). It is not “hopelessly naive” it’s more of a bias, the other side of the sunken costs fallacy. “If I invest in this I will find the motivation to perform”. Same principle for paying an annual lump sum to the gym and then never attending.

Though it seems the lesson is “never use fear of loss as a motivator”, fear of loss is simply a variable in a complex formula. You can’t rely entirely on it to get things done.