That's a beginner mistake, it's really hard to make if you dealt even a bit with some regular expressions.
s/\btwitter\.com\b/x.com/ig
1. your version replaces at-twitter.com with at-x.com
2. your version replaces twitter.com.au with x.com.au
I probably would have pushed back against the replace in the first place.