I do not know if this is common knowledge, I do not remember seeing any posts to this effect, but the entlast function is quite buggy. This applies to both the AutoCAD and the BricsCAD implementation. I have just found out that the BricsCAD team have actually gone out of their way to exactly emulate the quaint AutoCAD behavior.
The problem in a nutshell:
The return value of (entlast) can depend on the layout that was previously active. (There may of course be other issues...)
See the attached test files (Lisp and dwg).
Instead of entlast I advise using something like this:
(defun ReliableEntlast
( / ss
) )
)