Greetings
I need some help about calling PrintingTools from GeoprocessingServices by using PrintTask Class from ArcGIS API. When I call PrintingTool from using PrintTask by using ArcGIS API javascript, sometimes it comes back with an error.
======================================================
In my website, there is one function that can save the image from current Map Application. Sometimes it needs to produce numbered pin for locating various places. Sometimes, it is around 20-30 pins. It can go up to around 1000 pins in some cases. (Example is the below images). Then I used PrintTask to call PrintingTools to produce the map image.


The problem is sometimes, there is an error callback from PrintingTool like the below image. When error is going to happen, it always take a lot of time for PrintTask for calling PrintingTool until it sent back an error.

This error also occurs even with the same number of pin on map. For example, if there were 10 pins on map. When calling PrintingTool, sometimes it worked, sometimes it didn't and also had an error callback. Sometimes even 1000 pins worked while only 5 pin didn't.
When I try to check the error, I'm not sure whether it is related to the parameter that are sent to PrintingTool? I saw that sometimes some parameters are lost, like in the below image.There is no parameter "Web_Map_as_JSON" even though the source stated that it also send this parameter on Json
Parameters when somehow it didn't work

Parameters when it worked

Since I always send these parameters (Format, Layout, Map object) to the PrintTask to call PrintingTool. I'm not sure whether there is any external factors rather than my coding that affects the output.
I try to google the problems but no lucks, so I decided to post question here.
I hope that someone can help me explain the cause or give me some solutions to this problem
Thank you.