rs.GetObject not working for objects in Layout Detail

I found the solution here:

Thanks @clement