Actually, this topic was in a different section, and most of the comments are from speculators who have probably never owned a mining gear, I remember we had a similar one here which I can't seem to find, that one was jam-packed with info mostly posted by actual miners, I'll post it here if I managed to find it, meanwhile OP should try to search for it, it's here somewhere.
OP, this is an impossible-to-answer question, everyone will tell you a different answer and none of them is wrong/right simply because nobody can see the future.
If you were to backtest this question, you could easily cherry-pick periods were mining was better, and of course the same thing for the opposite side.
However, more often than not, buying
BTC at a bear market (which we are in now) was a lot more feasible than investing money in mining gears.
The logic is rather simple, just look at the price history of mining gears price, electricity price, and difficulty.
It won't take you much to see that mining gear values are generally in a downtrend while electricity price and difficulty are on a general bullish trend, in fact, you don't even need to look at the charts to know that, but of course, those trends have ups and downs, so there are periods where the whole trend shifts, but betting against the trend usually doesn't do you good.
You are buying a piece of gear that loses value over time, which runs on energy that goes up in price over time, all at the same time while that gear is costing you more to run just to make less.
This is why timing is key (of course assuming your power rate is below average which is 2-4 cents as of now) don't ask me how but that's what the large us corps are paying (according to them).
So if your power rate is within a combative range, your chances get better, but even with that, as DaveF mentioned the gear could just die on you halfway, it could get to a point where it burns more power than it makes, so the risk is just way too high compared to the rewards.
Some people think the USD value is what matters, so they complicate things and usually end up getting to the worst conclusion, I think measuring your ROI in BTC is the way to go, because your gear is making you BTC, not USD, and with the current gear prices ROI is anywhere from 1.5 to 2 years assuming your power rate is somehow fine.
Now think about it, do you really think your gear will run for 2 years straight without an issue? also, I know people that bought S19s for 15k or nearly 0.5
BTC back then who thought ROI was 1 year, it's now 2 years and they are not there yet, why? well because difficulty just keeps growing, the 2 years turn into 3 years, and so on.
You need to get lucky to actually beat DCAing BTC by just mining it, of course, this is the basis of it, Phill and some of the other American friends have another important factor they like to add in which is tax, I know little to nothing about U.S tax so I can't explain to you how mining beats buying BTC with respect to the tax laws of the united states or wherever you live.
But my long story short, don't buy gears that are over 1 year ROI in BTC based on your current power rate, because your power rate will likely go up along with difficulty and that 1 year ROI will likely be at least 1.5 years which is still somehow doable, anything above that and you will very likely not make it out, not with the halving happening in 2024.