Bugged build menus

The build menu in buildings/villagers can bug out and even hotkeys don’t work until I have clicked something else and then reselected the building/unit for example my TC can bug and I won’t be able to create vills or a vill will bug and have no build menu

I’ve encountered building menus not showing up, eg can’t train/research anything. Usually happens when using hot keys, have to select the building with the mouse for it to show up, sometimes several times.