If you're using any plugins which could change that value, you'll want to put the configuration line in after those plugins are loaded. For example, if you have a color scheme plugin, you may want to put vim.api.nvim_set_hl(0, "ColorColumn", { ctermbg='Red', bg='Red' })
in the configuration of the color scheme or in a config file which loads afterwards. I suspect you put the right code in, but it was just getting overwritten later.