The custom Export Web Map task using the stored credentials in a secured ArcGIS Server map service returns the error message, "Failed to create layer from service".
The fix has been also made available as a patch for ArcGIS Server 10.9.1. Download the patch from the following link:
https://support.esri.com/en/download/8085