after testing my code more I found if there are too many blocks to export it won't work either even in AutoCAD 2024,
no problem with a few blocks but not a lot of blocks.
it has a problem waiting on (command-s "._export" IgsName ent1 "") to finish before doing the next export.