The concept of the time value of money, as you say, is based on the idea that a dollar today is worth more than a dollar in the future. The reason is that that dollar can generate a return until we reach that future point in time we're valuing.
I think that to talk about the time value of money, a risk-free rate should be used. Otherwise, we'd be considering the risks of the business in addition to the time value of money.
In the example of the 2-year interest-free loan, at least that time value of money is being lost. Remember that we're not considering inflation or other factors (including the possibility of default).
That's because we're only looking at the time value of money. When we value using discounted cash flows, risks and inflation will be considered in the model, and the calculation will become more complex.