When enabling the option, 'Allow assignment of unique numeric IDs for map service publishing' in ArcMap, server services that are overwritten with a layer, which does not have a Layer ID in numerical order with the existing Layer IDs, cannot be selected in the Query or Attribute widgets in WebAppBuilder for ArcGIS (ArcGIS Online).
If the 'Allow assignment of unique numeric IDs for map service publishing' is enabled in ArcMap, ensure that no LayerIDs are skipped before publishing to ArcGIS for Server.