How to reproduce:
1. Create a new Unity project
2. Import the attached script to log any errors/warnings in the Console
3. Select the part of the text in the Console
4. Without unselecting the text, focus on other windows for some time, enter text anywhere else for ~10 seconds
5. Go back to the Editor and click on the same area of text that was previously selected
6. Observe the results
Expected results: No errors are thrown
Actual results: "Failed to perform selection on text" error is thrown
Reproducible with: 6000.5.0a1, 6000.5.8f1, 6000.6.0b7, 6000.7.0a4
Not reproducible with: 6000.0.81f1, 6000.4.0a3
Reproducible on: macOS Tahoe 26 (M1)
Not reproducible on: No other environment tested
Note: The issue is not 100% consistent but I was getting it every 2-3 tries