RealVNC uses the setting of the current attached HDMI monitor. If HDMI monitor is not present then it reverts to Composite resolution.
You need to force HDMI to stay on when unplugged.
Edit /boot/config.txt and remove the # from the line that has hdmi_force_hotplug=1
You may also need to enable and adjust these settings to the resolution you want to use
See this for details: viewtopic.php?f=28&t=5851&p=77547#p77547
There may be other ways to do this such as through a VNC config file of some sort?
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.