Based on current Microsoft documentation, this isn't supported directly with modern commanding.
For a subgrid command, the Power Fx visibility context is the subgrid itself. Self.Selected.Item and Self.Selected.Items work with records from the grid context and selected rows.
Self.Selected as the control context for command visibility, but there is no supported Power Fx expression that provides direct access to the parent form record from a subgrid command visibility rule.
PrimaryControl can be used in command actions (for example, JavaScript actions), but it is not documented as a value that can be used in a modern command visibility formula.
If you need to show or hide a subgrid button based on a field on the parent record, the recommended approach is still a classic ribbon customization (Ribbon Workbench/RibbonDiffXml) with a JavaScript Display Rule or Enable Rule, where you can access the parent form context. Alternatively, keep the button visible and perform the validation in the button action itself.