There are plenty of situations in which the terrible business decision is to rent instead of build. The difficulty is that without knowing the future it's not always clear, so you have to use your best judgment and hope you get it right.
Edit: Also don't forget that roll-your-own doesn't necessarily mean starting something from scratch. In many cases I opted to use and self-host an open source project that sometimes is sufficient all on its own, and when not we can make changes to it. I almost never start a non-trivial project from scratch just to avoid buying, unless it's a major piece of our product or value proposition in which case you have to consider the risk of building on a foundation you don't control.
I would say this is not a valid analogy. If you buy real estate you have an asset. However, if you build something that is not your core product you have a liability and not an asset. You're not going to get more money because you have a bunch of tech you built that you could have bought.
> I've rolled-my-own solution more than once as well when there were no other good competitors.
I don't want to be rude but this sounds like terrible business decisions. I would say this is a case of cutting your nose off to spite your face but I suspect it's not your money your wasting rolling-your-own solution. Like it normally costs a lot more in dev resources to build instead of buying. And it seems like your doing it because of your ego and your unwillingness to play stupid games.