now I wanted to script something that I'd love to cache out after so thus put a layerbreak over the python lop but trying to reference an existing prim now with stage.GetPrimAtPath("/my/fav/prim") now throws an error that I'm referencing an invalid null prim and traversing the stage yes it seems to think the stage is empty.
You absolutely cannot use the first approach. It will never work, because what you're telling USD to do is create a brand new stage that contains _only_ the active layer. Meaning most of your scene won't be there. You might want to dig into the docs at https://www.sidefx.com/docs/houdini/solaris/about_lops.html [www.sidefx.com] if you want some information about how LOP stages are structured. The Scene Graph Layers pane can be really helpful here too.
Your other approach is close, but not quite. As the Python LOP documentation says:
You must not edit the root layer of the stage.
But of course a python LOP must be editing _some_ layer on the stage, right? That's the "active layer". When you do:
stage=node.editableStage()
Houdini sets the Edit Target of the stage to the active layer. So if you want access the the Sdf.Layer object for the active (editable) layer, you just have to go through the edit target: