First, as a caveat, I know next to nothing about your personal situation, so the following is just how I'd think about it, which may or may not make sense for you.
If I could pay for the new house in full in cash, or even if I could have it paid off in under 5 years, I'd consider doing that, just to know there's 0 risk of losing my home to foreclosure (or would be within 5 years).
Assuming I couldn't do that, I'd get a 30-year fixed mortgage, which especially at today's rates will likely end up being the cheapest money you'll ever get.
As for paying more than 20% down, that's a bit of a head-scratcher at this particular point in time. The market is close to an all-time high, while we just learned that the economy contracted by almost 33% in the second quarter of 2020 (https://www.washingtonpost.com/business/2020/07/30/gdp-q2-coronavirus/). That's the worst quarterly result since they started tracking by quarters in 1947. For the full year of 1932, the US economy shrank by just 12%.
This means that the market is so far ignoring the economy, which IMHO can't last.
So... if I was in your shoes, I might choose to pay only 20% down, but then save the extra cash in a high-interest savings account if I thought I might need the money in the next 5-10 years. Money that's longer term, I might still invest, but I'd try to find as solid a mutual fund or ETF as I could, that has a really long track record of out-performing the market (there aren't too many of those). I'd especially think about diversifying broadly.
Don't know if any of the above helps, but that's what I'd consider doing (given my situation, not yours, which I don't know).