There seems to be a bit of confusion about the Hilbert-Einstein controversy [1], and I believe consensus is that Hilbert derived the equations a few days before Einstein, but did not claim ownership of the research. But this is the first time I'm hearing that Hilbert made a mistake. (I mean, maybe he did, but he got the right result eventually.)
[1] https://physics.stackexchange.com/questions/56892/did-hilber...
I was about to link you what I thought was best coverage of the priority I knew about, https://www.science.org/doi/10.1126/science.278.5341.1270 but now I see that's in the second edit of the accepted answer at your link.
(I certainly count myself among the confused, but I don't think there's any real dispute to answer.)
See also: this work alleging some foul play in the historical record - https://www.degruyter.com/document/doi/10.1515/zna-2004-1016...