Same issue for Mouse.h. Removing Mouse.h and Keyboard.h allows the KeyboardAndMouseControl sketch to compile and run.
Arduino: 1.8.12 (Linux), TD: 1.52-beta3, Board: "Teensy 4.1, Serial + Keyboard + Mouse + Joystick, 600 MHz, Faster, US English"
/home/corbett/arduino-1.8.12/arduino-builder...