If you pay it off that quickly there is any chance your bank won’t report it to the credit reporting agencies. It’s not like the moment you take out a loan it magically appears on your credit report. The bank has to tell them about it, which can take a couple of months for them to get around to doing. If the account is closed before they report its existence in the first place, they likely won’t bother reporting it at all.
Also, length of account history matters. Simply making one on time payment and then closing the account isn’t going to do much for you, and the effect begins to diminish immediately. Simply applying for the loan in the first place will lower your score, so it’s not even a guarantee that you would come out ahead.
Also important to note that the bank made you that loan expecting to earn a certain amount of interest. They will certainly take your early payment, but given the administrative effort to set up your loan, they will probably lose money on the deal. That could affect their willingness to make a similar type of loan to you in the future should you genuinely need one down the road