I just started seeing this the past few days. At first I thought it was just adjusting brightness automatically, but its dark outside and the lighting has been the same. I've noticed it most if I go from a dark window to a bright window, so my theory is that it is related to auto-brightness.
That or the new studio display is releasing this week, so it's time for Apple to make the old one have issues 😂