Assuming twitter.com/myusername becomes a Not Found page - search engines don't like lots of broken links, which is why many websites prevent (or limit) username changes. For example, Google gives every website a "crawl budget" - if Google finds lots of broken links (from old usernames), it won't crawl as many of the live pages, and so therefore might not find the new username pages. If Google can't find the page, it won't rank at all. It depends on the size of the website, but generally a small percentage of Not Found pages doesn't do any harm (though I do recommend fixing them if the resources are available).
If you want the profile pages to rank in search engines, a 301 Moved Permanently redirect should point from example.com/myusername to example.com/mynewusername - that will pretty much wipe out the negative impact of the non-existent page for the old user name, as it tells search engines where to find the new page (and is also helpful for anyone following the old link).