I think it makes more sense to wait for the addon to load, rather than forcing it to load as soon as you log in. It may help your error as well:
Lua Code:
local frame = CreateFrame("frame")
frame:RegisterEvent("ADDON_LOADED")
frame:SetScript("OnEvent", function(self, event, addon)
if addon == "Blizzard_CompactRaidFrames" then
CompactRaidFrameManager:SetFrameStrata("LOW")
self:UnregisterEvent("ADDON_LOADED")
end
end)
(Edit: fixed).