I think the elegantbook document class that has been distributed with MiKTeX is buggy. On CTAN, the class is marked as obsolete, so it is unclear to me what the current status or the latest version of this document class is.
Anyways, in the latest version that is distributed with MiKTeX (i.e. 2022/04/09 v4.3) we can find the following lines (line 1387 ff. in elegantbook.cls);
\renewcommand*{\cleardoublepage}{\clearpage\if@twoside \ifodd\c@page\else
\hbox{}%
\thispagestyle{empty}%
beforechap\newpage%
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
I can't really say what the author of the document class intended to do here, but this will print the word "beforechap" on every page when the twoside option is active.
A minimally invasive hotfix would be to place this in the pramble of your document and this way delete the annoying word:
\makeatletter
\renewcommand*{\cleardoublepage}{\clearpage\if@twoside \ifodd\c@page\else
\hbox{}%
\thispagestyle{empty}%
\newpage%
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
\makeatother
Note that there exists a newer version on GitHub in which this bug has apparently been fixed. Still, I am unsure about the maintenance status of this document class, so I'd rather suggest not to use it.
elegantbookclass is part of a standard TeX distribution. Therefore, you need to provide more information about where one can find the code for this class. Without access to the code of the class, it is hard to provide a helpful answer. At least, with the class with the same name that can be found on Overleaf, I cannot reproduce this problem. – Jasper Habicht Dec 14 '23 at 12:31