the risk free rate is not the best return. this is widely known. it is easy to beat the risk free rate, even if I take losses some years, I would destroy it in most others.
If you actually passed that course the professor should have their tenure revoked. The S&P500 rate is a rough proxy for the return on invested capital in the country, and it always crushes the risk fee rate over time.
I’ll give you a hint that may open your eyes. Volatility is not risk.