Unplugging HDMI does not trigger display change
After unplugging HDMI cable, your laptop still thinks the external monitor is connected and windows will not be moved back to laptop screen. (Kernel Bug 202579)
xrandr manually after unplugging HDMI. Or create a cron job to execute it every minute.
* * * * * /usr/bin/xrandr &> /dev/null
Laptop HDMI output is limited to 4K 30Hz
When connecting some laptop to external 4K (UHD) display, the refresh rate is limited to 30Hz.
Most GPU, including Intel Core GPU, supports 4K@60Hz, but not the HDMI controller. Most laptops and USB Type-C to HDMI adapters still provides HDMI 1.4 or older, which only support 4K@30Hz output. You need at least HDMI 2.0 to support 4K@60Hz output. If it is not available on your laptop, try to use USB Type-C (Thunderbolt) or (mini) DisplayPort, which should support 4K@60Hz. If you have to buy an adapter, make sure it is HDMI 2.0 adaptor, or DisplayPort adapter.
In some older 4K monitor, the HDMI port only support HDMI 1.4. Some have two HDMI ports, one is HDMI 1.4, the other is HDMI 2.0. You can try each HDMI port and if no success, switch to DisplayPort, which is always provided by 4K monitors.
If you connect to two or more 4K monitors, then GPU might become the limitation. Intel Core GPU support maximum one 4K@60Hz output. If you need multiple 4K@60Hz outputs, you need a more powerful GPU.