The Gemara Makkos 3b says:
א"ר יהודה אמר שמואל המלוה את חבירו לעשר שנים אין שביעית משמטתו ואע"ג דאתי לידי לא יגוש השתא מיהא לא קרינן ביה לא יגוש
If someone who makes a loan only payable in 10 years, the loan survives Shmittah because it wasn't collectible at the time of Shmittah.
However, the Torah says (Devorim 15:9):
הִשָּׁמֶר לְךָ פֶּן יִהְיֶה דָבָר עִם לְבָבְךָ בְלִיַּעַל לֵאמֹר קָרְבָה שְׁנַת הַשֶּׁבַע שְׁנַת הַשְּׁמִטָּה וְרָעָה עֵינְךָ בְּאָחִיךָ הָאֶבְיוֹן וְלֹא תִתֵּן לוֹ
That someone may say Shmittah is close, so I won't lend - this is an aveirah. (I have also heard this explain the idea of a Pruzbel - since Shmittah is rabbinic today, but not lending is Min HaTorah, so the Chachamim established a Pruzbel to prevent violating the Torah prohibition).
But if the loan can be made valid after Shmittah simply by making a longer term what is the problem? If the person is concerned about Shmittah, just make the term last past it. Why is this a problem?
It seems difficult to say that he wants the loan back close to the end of Shmittah, and will be worried he will be stuck in collections, as he can just avoid the problem by extending the term slightly anyway.