I have a minimal non-working example in my local folder /private/tmp/LyTeX/. My file source.lytex there contains
\documentclass{article}
\begin{document}
\input{/private/tmp/LyTeX/common.tex}
\begin{lilypond}
\relative c { c d e }
\end{lilypond}
\end{document}
It inputs a LaTeX file common.tex with some shared settings, for the minimal non-working example, the content is irrelevant, so I set its content here to
whatever
When I call
lilypond-book -o /private/tmp/LyTeX/outdir source.lytex
or
lilypond-book --output=/private/tmp/LyTeX/outdir source.lytex,
despite the output directory setting, I always get the failure:
lilypond-book (GNU LilyPond) 2.24.1
Reading `/private/tmp/LyTeX/source.lytex'
[…]
Processing include `/private/tmp/LyTeX/common.tex'
lilypond-book: error: Output would overwrite input file; use --output.
Note that there is no failure if common.tex is input using a relative path.