Ignore the last statement about longsword proficiency
This is a bit of a guess, but I'm pretty sure that last additional statement about longsword proficiency is a side-effect of how D&D Beyond works. When you create a magic weapon or armor, you have to specify a weapon or armor type that your item is based on.
An additional sentence is then added automatically to the description stating basic proficiency rules or appearance.
This is actually a problem for items that specifically state special properties in the description that overrule general proficiency rules or appearance - the Sun Blade being one such example, where proficiency in either longswords or shortswords allows you to be proficient in using it. (And I've hit the problem myself when creating homebrew items!)
The same item in the Dungeon Master's Guide book (page 205-206) does not have this additional sentence, lending evidence that this last sentence is just a "D&D Beyond implementation issue".
@Someone_Evil provided this link to the Sun Blade in the DMG compendium for comparison. It does not include the second portion you quoted; that is copied directly from the entry for the regular longsword.