The IDs 102100 and 3857 both represent the same spatial reference: WGS84 Web Mercator (Auxiliary Sphere), so it would seem unlikely that the cause of the issue is due to a spatial reference system mismatch.
Input Parameters:
<Geometry> geometry Required Can be a Point or Extent.
esri/geometry/Extent::contains take a point or extent. Per the docs:
https://developers.arcgis.com/en/javascript/jsapi/extent.html#contains
You could use the extent of your line but not the line itself.
esri/geometry/Extent::contains take a point or extent. Per the docs:
https://developers.arcgis.com/en/javascript/jsapi/extent.html#contains
You could use the extent of your line but not the line itself.