Inability to print the appropriate legend using a layout with the 'Only show features visible in the map extent' option checked in the ArcGIS Enterprise portal.
The issue is no longer reproducible. If a map service (map image layer) is used in the web map, the server-hosted map services must be updated to a newer release. Map services running on older servers do not support the dynamic legend capability.