Whenever you purchase a used computer you should always perform a clean install of the OS by first erasing the whole physical drive before installing macOS. This will ensure the OS is absolutely clean with no nasty surprises from the previous owner. It also helps to make sure the laptop does not have a firmware lock enabled and that the Mac is not being managed by a previous owner. While booted to the macOS installer use Disk Utility to erase the whole physical drive the details depend on the OS being installed and may require clicking "View" within Disk Utility and selecting "Show All Devices" so that the physical drive appears on the left pane of Disk Utility (macOS 10.13+). Here is what the previous owner should have done before selling the Mac:
https://support.apple.com/en-us/HT201065
It sounds like you incorrectly modified the short user name of the user account. FYI, here is an Apple article with the correct instructions for modifying the short user name of a macOS user account:
https://support.apple.com/en-us/HT201548
Since this is a "new" to you computer I highly recommend performing the clean install. If you have important files that are not backed up, then I suggest transferring those files to an external drive so you can perform a clean install. Otherwise you can restore from a backup made before the change.