Seems like a bug to me at a glance, worth reporting over on Feedback Assistant.
If I remember correctly, we wrote this part of the grammar before keypaths supported subscripts; seems plausible that we missed this formulation when going back to update it.