Calculate the return when investing the cash flows at the specified rate of return for a certain amount of periods

If we plug in our monthly home loan payments and our monthly interest rate, the calculated future value is equal to the return when the loan amount of 387900 is invested at that same rate for 360 months. And thus this tells thus that either scenario is equally profitable investment for the bank.