Yes paying off a loan too early can sometimes lower your credit score.
It would seem the opposite but that's the reality. It's much better to keep the loan open for the full term and continue to make those loan payments.
The longer the loan term and the longer the payments will help boost your credit as long as you make those payments on time because it shows a payment history.
So if possible leave the loan open and continue to make the monthly payments to see a good raise in your credit score overtime.
Also paying off a loan early could cause you to have to pay a early loan payoff penalty so it's best to keep the loan open for the full term and pay it off at the end of the loan term.