Hey I have made some progress and the ouput being an object is not causing issue anymore.
But still the premiere pro is not able to receive the output of the api call.
In the attached screenshot you can see that there are 2 functions. The first function makes the api call and flattens the output to a string. And the second function sends data to premeire. But when it is called premiere shows not output. So, I put some alerts to check what was working and what wasn't. So when this function is called only the first alert works and then it doesn't respond or return any alert after that which probably means that the line "const result = await apiOutput0();" is never executed. That line works fine when checked in the js using console.log but while sending to jsx nothing gets executed after that line.
(Also the api call takes a few seconds to generate the output so I put the setTimeOut there but idk if that serves any objective or not)