- the Lagrangian of gravity is completely different from a Yang-Mills Lagrangian, and we work with it in a completely different way, which makes a noncompact group less of a problem. We don't seek or expect a nonnegative Hamiltonian, for example.... for reasons I don't have the energy to explain here.
If you want to see how good physicists work with a crazy noncompact group, try Nesti and Percacci's work on a "gravity-GUT" that uses SO(3,11) to combine SO(3,1) for gravity and an SO(10) gauge theory:
https://arxiv.org/abs/0909.4537