There are two instances when the replacement occurs. The first is the docstrip step, when the source is read and the code from the source .dtx is copied to the target .sty/.cls file, and the second when the code is read once again to typeset the documentation and implementation.
In the docstrip step the l3docstrip.tex code is used, which patches the \...
The l3doc class uses fancyvrb to enhance the verbatim environment. To make all verbatim environments fancy it does
\cs_gset_eq:NN \verbatim \Verbatim
\cs_gset_eq:NN \endverbatim \endVerbatim
The problem with that is the interference with packages like minted which also rely on fancyvrb. Knowing what l3doc does it is easy to patch for case ...