Unfortunately I am not able in writing code.
In the specific case I use gnome-control-center (version 43.4) within a distribution (Debian 12 - still testing) and I think (like you wrote) I should recompile and reinstall the same … 43.4
Among other things, I noticed a small bug that afflicts almost all the versions of gnome-control-center. This bug (?) started (I think) from the version 43 (of Debian 12 for example). Certainly also present in the latest version 44 of gnome-control-center (present in Fedora 38, for example).
This happens (seeing is believing) : if an idle-delay value is set in this way for 20 minutes:
gsettings set org.gnome.desktop.session idle-delay 1200
If you return to the Settings and Energy menu, the value is set to “Never”.
Even if everything works. I think it’s a bug.