You still need to consider the functional aspects of the service, as well. Perhaps you're using some critical software that suddenly has a very bad CVE. It turns out that the only developer working on it was hit by a bus, and now the magical connector between your git server and your LDAP server has no functional replacement (or the replacement isn't compatible with your current setup). No amount of better abstractions will prevent a painful midnight page.
There will always be a meaningful amount of effort involved in supporting your own systems, and that cost (be it in ongoing maintenance time, or in lost time because your own system failed) _can_ always be higher than paying to outsource the work to a trusted third party.