I think 21k is way too much for a bike that's 5 years old, no warranty and not broken in yet. I bought a 17 SGS new in 2017 and paid 23,500 out the door and that included sales tax@ 5.5%. Your friend didn't get a very good deal if he owes 21k on a 2017.
For reference, after trading it, my dealership sold my black '18 SG with no upgrades other than an LED headlight for $19.5 with over 12k miles and needing paint work.
The main thing is, if you are happy, and he ( she) is happy with what you agreed on, and you look happy in the picture, then its all good, Does seem a little high, especially the payoff, enjoy it, nice bike
21K for a low mileage bike from someone you know who has not beaten it to death, with a couple of upgrades is not a bad deal.
My local Kawi dealer has 3 FLHXS for sale, about 6K on each of them, 2020 models and they are asking OVER MSRP for them
Even if you overpaid by a couple grand ( and I do not think you did) over a few years of ownership it ends up being less than a 12 pack of crappy beer a week... Glad you are happy with the bike, now go ride the wheels off it