Bug where you couldn’t add permissions to sub-category even though parent category is accessible by everyone was fixed few weeks ago (FIX: any subcategory permissions are valid if everyone has access to … · discourse/discourse@fea5d4f · GitHub)
You have to make sure group 1, group 2 etc. have permissions to see parent category before adding them to sub-categories.
I improved error message so it’s clearer now which groups only have access to sub-category and should be added to parent category: