Thanks for the tips. Based on trying out your advice, I'm more stumped now than before.
This code runs in a loop, there are nine other queries (the next longest is 91821 characters, returning 7374 records) I'm running (all on the same feature service) and saving each resulting feature set as a feature class. This is the only one of those queries that results in error.
Trying a subset of IDs in the query, I can query up to 59 IDs successfully. Adding the 60th results in the error. Starting at the 60th, I can query the next 8821 IDs successfully. Adding the 8822nd results in the error. Starting at the 8822nd, I can query the remaining 1460 IDs successfully.
Is there a rhyme or reason to these apparent limits or is this just a cursed query? I suppose I can write those into my code to make it work, but it's confusing to me why it would need to be like this.