I think it's necessary to point out an additional irony.
The one counter-example is Mank. Mank, famously, is the story about the battle between Orson Welles and Herman Mankiewiekz for credit in writing Citizen Kane.
The basic gist, regardless of how you view the historical accuracy, is correct- the director did not want to give the writer credit for the screenplay. They ended up both getting credit (and both winning the Oscar).
From this, we get a story as old as Hollywood. Directors will often get co-writing credit. Sometimes very deserved, sometimes somewhat deserved, sometimes ... well, sometimes they get a credit.