I'm trying to add data from a Feature Layer with token-based security to ArcGIS online. I'm able to enter the URL, which gets recognized as an "ArcGIS Server web service", I check "store credentials with service item" and enter the username/password on the next screen. However, when I try to save the item, I get an error:

Checking in dev tool in the "network" tab, I see the response is
{
"error": {
"code": 500,
"messageCode": "DB_0127",
"message": "Unable to create item proxy.",
"details": [
"Unable to create item proxy."
]
}
}
This does not happen with open (no username/password) services that are identical. The addItem request looks valid to me, according to the REST API docs, but the request still fails. What could be going on here?