first off thanks for sharing your code. It gave me a headstart when I tried to do something very similar.
I found out (pretty much the same way you did) that the only attributes that can be passed into the call are displayname and email. There's a MS doco page on this:
https://learn.microsoft.com/en-us/graph/api/resources/invitation?view=graph-rest-1.0
I tried to update the jobTitle (an example) and found that I needed a separate API entrypoint to do this:
https://learn.microsoft.com/en-us/graph/api/user-update?view=graph-rest-1.0&tabs=http
and then I found out I needed different permissions for my SPN to make the change, as opposed to invite a guest. For me, it was easier to do post-invite changes using our ServiceDesk software. However, in pure Python, that's the way I'd go.