You can buy Bitcoin on the stock market through Robinhood. As long as you have funds you can buy instantly.
You're not necessarily buying on the stock market (unless you're buying Grayscale's GBTC), but you're pretty much buying IOUs through platforms such as Robinhood where you can't withdraw your coins. This is a huge no-go unless you're not planning on withdrawing your coins but instead just planning on purely speculating.