My homes have definitely been investments, in fact they have spring-boarded my career in real estate investing.
My first home was purchased in an up-and coming area at the right time during the great recession. It produced an annual 30% increase in value upon sale (150% annual CoC return) that I paid no taxes on due to the principal residence exemption.
My next home was on a property that I subdivided and built a second home on. The first home produced an annual 5% increase in value upon on sale (24% annual CoC return). The second home (on the new lot) produced an infinite return (no cash down due to a dirt equity construction loan). Overall the entire project produced about a 40% annual CoC return which I paid no taxes on due to utilizing the principal residence exemption (twice).
While I likely won't ever be able to replicate either of these projects, you have to be willing to put a lot of thought and energy into finding value before anyone else can see it or in ways other people tell you isn't possible. I love it when experts tell me I can't do something.