It’s almost always the case that maxing out your ESPP contribution is a good idea instead of getting the money earlier and investing it in something else. It might even be worth getting a loan and still maxing out the contribution should you require more cashflow (because 10% loan is still cheaper than missing out on ~90% return). But the t return is limited to your max contribution percentage * your salary, therefore you still need to think about what to do with rest of your money.
How making more money in absolute terms in some other investment invalidate the above?