PFA, a small patch attached which should fix this. I have made relevant changes in the relevant regression files too.
I was wondering though if there are other locations where we might need to add checks to ensure that ALTER TABLE ONLY parentrel operations are ok? I did see checks for this in some other operations like ADD COLUMN already in place too.