Hi there D,
Welcome to Apple Support Communities.
After hitting the X, how are you using the external display? Is the MacBook closed?
If you choose or set up an extended display or mirroring, does the Touch Bar still disappear?
Use one or more external displays with your Mac - Apple Support
"Set up the displays as an extended desktop
You can arrange your displays in any configuration to create an extended desktop. For example, you can set your external display side by side with your Mac to create one large continuous desktop.
Note: You must be connected to a display to see these options.
- On your Mac, choose Apple menu
> System Preferences, click Displays
, then click Display Settings. - Click the name of your display, then choose Extend Display from the pop-up menu.
Set up the displays for video mirroring
Video mirroring shows the entire desktop on each display.
Note: You must be connected to a display to see these options.
- On your Mac, choose Apple menu
> System Preferences, click Displays
, then click Display Settings. - Select your display, then choose Mirror for Display from the pop-up menu."
Are you using an iPad? Use an iPad as a second display for a Mac - Apple Support
"Use the Touch Bar
Many apps on Mac have Touch Bar controls that make common actions even easier. With Sidecar, you get a Touch Bar on your iPad screen even if your Mac doesn’t have a Touch Bar. Tap its controls with either your finger or Apple Pencil. If the Touch Bar doesn't appear when using an app that offers Touch Bar controls, choose Apple menu > System Preferences, click Mission Control, then make sure that “Displays have separate Spaces” is selected."
Best regards!