Ugrading glibc is a bad idea in general, but especially by just replacing the binary. Why would you do it? What are you trying to achieve? 2.31 is not so old. It's the default glibc version on Ubuntu 20.04 LTS.
See
here, to give you an idea of how many things depend on glibc.