Postgres 12: Inserting array of composite types, composite type has an array field. Malformed array literal, unexpected end of input
Write the inner array in braces, and escape the comma in that with double quotes around the array literal:
SELECT ARRAY[
          '(sdf,&quot;{2002,2005}&quot;,2021-01-19T21:48:28.997Z,1001,7001,3,6001,1)',
          '(sdf,&quot;{2002,2005}&quot;,2021-01-19T21:48:29.626Z,1001,7002,3,6001,1)'
       ]::new_ans_obj[];

                                                                      array                                                                      
-------------------------------------------------------------------------------------------------------------------------------------------------
 {&quot;(sdf,\&quot;{2002,2005}\&quot;,\&quot;2021-01-19 21:48:28.997\&quot;,1001,7001,3,6001,1)&quot;,&quot;(sdf,\&quot;{2002,2005}\&quot;,\&quot;2021-01-19 21:48:29.626\&quot;,1001,7002,3,6001,1)&quot;}
(1 row)