Replace in the code subcategory by subcategories
Or adapt requirements on content types configuration as it says :
1- A category content type with a bare minimum of a name short text/symbol field and a subcategories multi-reference field; you certainly can have any other fields you want.