Thanks Leah. The issue is that it looks like the visibility changes don't affect the sections on a quick view. I already have the grid on a section. But because the visibility toggle doesn't work with the section, I am trying to hide the grid instead. This is what I am trying:
const custTab = formContext.ui.quickForms.get("Account");
const testSubgrid = custTab.getControl("relatedCaseGrid");
const tab = custTab.ui.tabs.get("tab_1");
const section = tab.sections.get("Cases_Section");
section.setVisible(false); // for the section
OR
testSubgrid.setVisible(false); // for the subgrid