Window ModalWindow: NullReferenceException

I’m encountering a curious error that seems to be an error on the part of UT.
I have a wrapper around UnityGUI that wraps everything in a nice object hierarchy.
I have one “control” that is a window, it exposes WindowID.
When I:
Disable the gameobject with this control component, or change the WindowID, I get the following error:

NullReferenceException: Object reference not set to an instance of an object
UnityEngine.GUI.CallWindowDelegate (UnityEngine.WindowFunction func, Int32 id, UnityEngine.GUISkin _skin, Int32 forceRect, Single width, Single height, UnityEngine.GUIStyle style) (at C:/BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/Editor/GUI.cs:1283)

Any help? Is this a Unity bug I should report?

Ah, well this is pretty stupid.
I’ve finally found the culprit: useGUILayout.
If I comment out that one line (in Start) my windows work EXACTLY as they should, no errors, nothing.
If I set it to true, then it breaks the windows. Some don’t render, some throw errors, etc.