@jackyan The rules for who gets writing credits on a movie can be complicated. See the U.S. Writer’s Guild West’s rules here to see what I mean: https://www.wga.org/contracts/credits/manuals/screen-credits-manual
My guess here is that Bacall wrote an early draft of the screenplay by himself, and then a later draft was produced in collaboration between him and Wright. Elements from both drafts made it into the final shooting script. Bacall and Wright are getting credited together for their collaboratively produced work, but the final shooting script retained enough of Bacall’s original draft to merit a separate credit for that work.