The cause of the problem is that the bidi package redefines tikzpicture
and pgfpicture
in a way which puts them into a paragraph. The following also does not work properly with your MWE, if bidi is enabled:
Lorem ipsum before \tikz\node[draw] {text}; lorem ipsum after
One could reset pgfpicture
locally to its original behaviour. But, of course, this would disable the bidi adaptions also (locally). But, maybe, this does not matter for you application. Try the following:
\documentclass{article}
\usepackage[most]{tcolorbox}
\usepackage{bidi}
\makeatletter
\tcbset{%
bidi reset/.code={%
\let\pgfpicture\origin@pgfpicture%
\let\endpgfpicture\origin@endpgfpicture%
}
}
\makeatother
\begin{document}
Lorem ipsum before \tcbox[bidi reset, size=tight, on line]{some tcb text} lorem ipsum after
\end{document}
This works for the MWE. But, it may not give the expected results for your intended application since you will have included bidi for a reason...