It was painful but eventually I was able to dig far enough into the scripts to get a correlation Id for the error which allowed me to examine the SharePoint ULS logs. There, I found a much more helpful error message letting me know that the lookup list threshold was being exceeded. The lookup list threshold is a resource-saving setting that tells SharePoint to only show so many lookup fields to users, since each lookup field requires loading a whole other list. You can imagine if you have a list with, say, 100 lookup fields, having SharePoint load 100 extra lists whenever you want to look at it would be cumbersome on both the system and the user’s patience. There is a setting for each Web Application in Central Administration that limits the amount of lookup fields that regular users are allowed to load in one request.
Unhelpful error messages are a real pain, especially when you can very easily tell at a glance that the reported error is just plain wrong. Hopefully I’ve saved someone else the trouble having to debug scripts in the browser until something actually helpful pops up.