The "profession" or "role" summary at the top of a name page is typically generated automatically based on the filmography credits associated with that page. Once credits are added, the system will automatically display the applicable professions (i.e. Actor/Actress, Director, Producer, etc.) based on the number of each profession credit listed on the page (excluding "Thanks," "Self" & "Archive footage" credits). When a profession has more credits associated with it, it'll automatically update at the top of the page.
Episodes are counted as individual titles when deciding the professional ordering. This means, while it may appear that the ordering is incorrect based on the headings under Filmography - once you include episodes in the count, this will line up as expected.
Since this is an entirely mathematical approach, the profession order may occasionally not be the best or most representative. If you're an active IMDbPro member, you can select your profession display order - this is explained more in our manage your primary professions article.
There are exceptions to the automatically generated professions, these include Music Artist and Podcaster, which at this time can only be selected by IMDbPro members or added by staff.