The fafsa formula has 2 main components, income and assets. The income is from 2 years prior while the assets are current as of the filing date. Timing is everything.
In your scenario, you might earn the money in 2020, spend it in 2021, and file the FAFSA in 2021 to start school in 2022. Yes, the income will ‘show’ on the FAFSA (and MIT uses the CSS too) and yes, schools will most likely expect that $40k to be used in part to pay for your education if that’s the tax year used.
You could take a double gap, but at some point if you are earning $40k per year, you are going to be expected to use it for college and not for travel.