I can no longer stop x6-88 from following me around, even if he is not my companion. This is a game-breaking (or at least, story-breaking) bug. Some details in spoiler tag.
I have tried switching to another companion. I am given the menu to select where to send x6, but he does not go.
I have tried dismissing x6 outright, with same results as above.
I have tried murdering x6, which doesn't work for obvious reasons.
I have tried saving the game, quitting, and doing a full reload, and the behavior persists across game restart.
After dismissing or switching companions, x6 continues to follow me physically, and via fast-travel. His menu options have him asking me "is it time to go again?" - so he clearly knows he is not supposed to be my companion any longer.
I have found this bug reported on the Fallout wikia under the x86 entry. It was marked as Console and verification needed. I set it to verified, and added the PC platform.
Spoiler
I am at the "Talk to Desdemona" stage of "The Nuclear Option" and "Rocket's Red Glare".
I used x6-86 as my companion during the Rocket's Red Glare quest.
Therefore, I can no longer continue the Railroad storyline because x6-86 always comes with me, turning the Railroad hostile.