I don't know what the reason for making the variable read only is. But I think you could work around it by setting BASH_COMPLETION_COMPAT_DIR to a fake value, e.g. /prevent/sourcing in your rc files before the profile.d snippet is sourced (thus preventing it from loading bash_completion), and then unsetting it before "manually" loading the profile.d snippet where you want, and let it do its job unmodified.
- Bug#857235: bash-completion: /etc/profile.d/bash... Stephen Dowdy (resonance)
- Bug#857235: [Bash-completion-devel] Bug#857... Ville Skyttä
- Bug#857235: [Bash-completion-devel] Bug... Stephen Dowdy