Sit tight and at the end of this answer all will be resolved and packages will be loaded in just the order they like.
Phase 1: From bidi deferral to polyglossia deferral
You are likely failing to defer the loading of bidi because bidi is automatically loaded by polyglossia when you indicate you'll be using a right-to-left language (specifically, Hebrew) - at the point of that indication, probably; and early-on, certainly.
So let's drop the explicit loading of bidi, and defer polyglossia:
\AtBeginDocument{\usepackage{polyglossia}}
... but this also results in an error, e.g.
! Undefined control sequence.
<recently read> \setmainlanguage
l.125 \setmainlanguage
{english}
Phase 2: Deferring polyglossia-related commands
While you want to defer loading polyglossia, your preamble likely has any polyglossia-related command, such as \setmainlanguage, \setotherlanguage, \newfontfamily and so on.
Ok, then - let's defer all of them together! After all, we're not actually typesetting any text in any language while still in the preamble. Sample code:
\AtBeginDocument{
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage[numerals=arabic,calendar=gregorian]{hebrew}
\newfontfamily\hebrewfont[Script=Hebrew]{David CLM}
}
... but we're foiled again. This time the with the error:
! LaTeX Error: Can be used only in preamble.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.21 \AtEndPreamble
{\let\bbl@set@language\xpg@set@language} %for biblatex
Phase 3: Tweaking the deferral destination does the trick
Now this is interesting... it looks like one of the polyglossia-related commands issues an \AtEndPreamble, which can obviously not be issued when the document has begun and the preamble is ended. But if that's when it really wants to run, why not oblige it? Let's defer polyglossia (and thus also bidi) to \AtEndPreamble instead of to \AtBeginDocument:
\RequirePackage{etoolbox} % provides \AtEndPreamble
\AtEndPreamble{
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage[numerals=arabic,calendar=gregorian]{hebrew}
\newfontfamily\hebrewfont[Script=Hebrew]{David CLM}
}
... and this works.
Phase 4: Tuning the deferral
@UlrikeFischer suggests we can make do with just preventing polyglossia from loading bidi early on. Thus, the following:
\RequirePackage{etoolbox} % provides \AtEndPreamble
\RequirePackage{polyglossia}
\setmainlanguage{english}
\AtEndPreamble{
\setotherlanguage[numerals=arabic,calendar=gregorian]{hebrew}
\newfontfamily\hebrewfont[Script=Hebrew]{David CLM}
}
Also works. Now other packages which expect polyglossia to be available will not be adversely affected.
Note: The polyglossia-related commands can use \AtEndPremable because polyglossia itself makes it available by its own \RequirePackage{etoolbox}; but I'm not making that assumption in the code above.