Just a note that the "#<ArgumentError: file does not exist>" exception apparently can also manifest if code tries to open the same .layout filepath twice in a SketchUp session.
I.e., there is no Layout::Document#close method. In a reported error, the coder was attempting to use ::open instead of ::new which I think led to a problem with the file handle still open by the system.