Well first off ---- NET PROFIT by definition is Gross Profit - Expenses = Net Profit.
So your first equation of (NET GAIN - COST of INVESTMENT ) / COST of INVESTMENT doesn’t make alot of sense.
ROI should look like this (NET GAIN / COST of INVESTMENT) OR (GROSS GAIN - EXPENSES) / COST of INVESTMENT.
I’m not sure what you are trying to accomplish with your second equation of Expenses / Net Gain. That equation would do little other than to help analyze risk. Since in this case you’re basically figuring out the percentage of the gain relative to the risk (capital outlay in the form of expense).