I have installed VNCViewer by RealVNC on my Raspberry Pi 3A+. But after a restart of my RPi I have to connect a USB Keyboard and press a random key to get the connection working. I can easily connect through SSH. The connections are set to be automatically accepted for VNC and I have set the boot mode on my Raspberry to automatically sign in and use the desktop version.
This is a known issue when starting without a keyboard or mouse plugged in, luckily someone has come up with a solution here: https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=230779
In short, the problem is that the Pi is waiting for mouse or keyboard input to initialise its random number generator. The solution suggested in the link above is to install an entropy generator that doesn't require input, such as 'haveged'.