I can see how this would be confusing. But what you’re running into here is a current limitation in Figma. Layout grids don’t display or function when a frame is rotated (for example, 90° or -90°). Grids are tied to the frame’s original orientation, so rotating the frame causes them to disappear or behave unexpectedly.
As a workaround, you can keep the frame rotation set to 0° and adjust the width and height to switch between portrait and landscape instead. If needed, you can rotate the contents inside the frame rather than the frame itself. Hope this helps!