Obviously trying to detect a gas system leak using an ambient CO2 sensor is impractical, not to mention way too imprecise to be useful. Then, trying to detect a gas leak via a pressure sensor won't work as the system pressure will be maintained at precisely the regulator setting - until the source of gas is exhausted. And using a flow meter runs into the problem of dealing with a keg of beer that hasn't reached equilibrium - and thus is "consuming" gas.
The best way to deal with a leak is to take it head-on, break the system down to the cylinder and regulator to start, bubble-check the hell out of that, then start connecting down-stream tubing/manifolds/QDs etc, testing along the way.
When I build a distribution system, everything goes in a dunk tank except the regulator itself. The last system I built had four leaks on first assembly, some due to manufacturing errors, the others my own. I'd likely still be chasing at least one of those if the system had been installed without dunk testing.
For suspect kegs, one can wrap duct tape around the handles to create a "well" that can hold water long enough to expose leaks. Gas leaking from the lid, PRV, posts, even QDs, will be revealed...
Cheers!