The problem reported in the original post even arrives at the beginning of the game, it is because the program does something else at the same time as the user interactions.
In this case, the program gave me back the hand to build the starbase (the constructor was "idle ship").
This is because the "end of the turn" is not really the end of the player's turn. If the player's ships still have movement points when they make the programmed movements, the hand is given back to the player so that he completes the movements, which is normal, but at this precise moment, the program must not try to do something else.