I'm having a possible bug while using Query Widget in WebAppbuilder using ArcGIS Enterprise Portal (ver. 10.7.1). While you only use one item per application it works fine, but as soon as you add another Query widget it fails to switch between widget windows. Showing either one empty. It seems to work well in ArcGIS Online environment.
Would be creat if one could use Query Widget on the same purposes in Portal for ArcGIS as we often need to separate old and new sources for catering information using queries.
I just tested this in Portal 10.8 and it works as you expect it to from your experience with ArcGIS Online.
Portal for ArcGIS 10.7.1 is now a couple of versions behind ArcGIS Online, so the likelihood is that this is a bug that has been previously identified and fixed.