As Carlie notes above, the error you are seeing is likely from your python code writing files using a form of netCDF that is incompatible with the version compiled with your version of IOAPI.
But even if you fix that issue, you will likely run into other problems. IOAPI is an interface, and you should use that interface to create the files. If you want to combine species from different existing ICON files (assuming they have the same time stamp and are on the same domain), then you can use EPA’s combine program, or one of the IOAPI tools, perhaps m3combo.