OK, I know anonymous blocks, but AFAIK, they're stored in the blocks collection, not in the layout block.
As far as I understand, layoutBtr refers to the layout block definition as the object got with the vlisp expression (I'm more comfortable with LISP):
(vla-get-Block (vla-item (vla-get-Layouts ...) "Layout1")).
If I'm true, the false parameter should have been here:
BlockReference blk = tr.GetObject(id, OpenMode.ForRead, false) as BlockReference;
EDIT: I tried both an exploded dimension and a dynamic bloc.
Only the dynamic bloc is founded whatever the IsAnonymous condition, even I found "*D2" and "*U4" in the block collection (BlockTable).
And it seems there's no need to the false parameter if a block reference have been erased.