Unable to retrieve correct object IDs using BricsCAD20 and BricsCAD21 but get correctIDs frm v19

We are trying to get the objIDs from the blcktable record for both ModelSpace and Paperspace and noticed that there is some issue with the object IDs of BCADv20 & 21 where as v19 BCAD is able to get us with the correct object IDs. Please suggest. Attached the source code, sample drawing file, log file of v20 & v19 in both Model space and Paper space. Let us know if any further details are required in this regard. Thank you so much inadvance for all your support!