I don't know why that error is appearing. More info is needed to even begin to diagnose the issue.
Before you go to the effort of collecting more info, please do the easiest thing first. Download and use a fresh copy of the 1.59 installer. It's at this page:
www.pjrc.com
Scroll down to "Arduino 1.8.x Software Development".
Regarding your original question to explain why, my best guess is you may have an incomplete or incorrect install of the software. Just running the 1.59 installer should fix that. Or you could re-run the Arduino IDE installer, which gives you a fresh copy of Arduino IDE (without Teensy) and then run the Teensyduino installer.
But back to the guesswork to explain why, sometimes problems with old Arduino IDE happen when trying to use the Boards Manager way to install. For Teensy install by Boards Manager is only supported for Arduino IDE 2.0.4 and later. It will not work on Arduino IDE 1.8.x. The files today will not even install on old IDE, but before we switched to zstd compression, it was possible to incorrectly install the files meant for Arduino IDE 2.x.x onto Arduino IDE 1.8.x. It leads to all sorts of strange problems with recognizing the USB devices and use of serial monitor.
Also possible is Windows Defender or other anti-virus software may have "quarantined" one or more of the files from Teensy's software. It was a huge problem a couple years ago, but seems to be less common recently (or perhaps it is still an issue but we have answered the question so many times that people find the info by search....)
If you really want to find out why, more info is needed. Click Help > About. You should see the IDE version and Teensyduino version. Best to show a screenshot. The other info come from verbose output. Click File > Preferences. Turn on verbose output for both compile and upload. Then when you click Upload, Arduino IDE will show much more info. Best to copy it all to clipboard and paste here in the forum. It will be very long. Click the forum </> button to copy that info, so it is easier for us to read. Odds are good that excessive info, together with knowing exactly which version of the software you have installed, can shine some light on the real reason why things are going wrong.
But whatever is wrong, the solution is probably to just run the 1.59 installer (not Boards Manager) to reinstall a good copy of the software.