The variable ancliste is not defined in your code, resulting in the DXF group (nil . 18.0) hence causing the error: bad DXF group nil.
In addition, there is no need for the ssget expression, and you are also using entmod with the old DXF data list bound to the ent variable, and not the modified DXF data.
Consider the following code:
Code:(setq ent (entget (entlast))) ent (subst '(43 . 18.0) (assoc 43 ent) ent) ) (entmod ent)