I solved this issue with some help from esri technical support. I used fiddler to monitor the queries that WAB was making to the feature service. It appears that for the line layer it was including a list of the fields in the outFields property of the query call. One of the fields it including didn't exist in the feature layer, so the query was failing.
I think the reason why it included a field that didn't exist had to do with how I originally published the feature service from Pro.
Somehow I think I copied the popup configuration from other layers in my map that I published from. I know I used the 'Apply Symbology' tool, but not sure if this copied the popup configuration too. Regardless, for my polyline and polygon layers, I had the popups configured to show the Shape_Area and Shape_Length fields. This popup configuration got published as-is to the AGOL hosted feature layer. In other words, the fieldInfos arrays in popupInfo and popupElements in the hosted feature layer included those fields with the single underscore, not the double underscore (Shape_Area, Shape_Length). Those fields don't exist once it's published (only in the gdb that it was published from), but publishing the feature service with those popup configurations doesn't cause an error.
The issue occurs in WAB because it appears it uses those fieldInfos arrays to populate the outFields parameter in the queries that it makes to the REST API.
I confirmed that this was the issue in two ways.
- I used ago-assistant.com to edit the JSON for the hosted feature layer contained in the the web map that the web app was using. I added the additional underscore for every instance of those Shape fields. The info summary widget now works fine.
- I went back to ArcGIS Pro and the map that I was using to publish the hosted feature layer to AGOL. I reset the popup configuration and republished. The fieldInfos arrays now contain the correct names for the Shape__Area and Shape__Length fields (with the double underscore).