در کلاس bidi-tufte کدهای مربوط به عنوان قسمتها بعد از فراخوانی شدن بسته bidi تعریف میشود بنابراین کدهای شما هیچ تأثیری ندارند مگر اینکه آنها را بعد از فراخوانی بسته xepersian انتقال دهید. همچنین داخل \parbox باید محدوده رنگ را مشخص کنید:
\documentclass{biditufte-book}  
% add numbers to chapters, sections, subsections
\setcounter{secnumdepth}{2}
\usepackage{ptext}
\usepackage{xepersian}
\settextfont{Yas}
\titleformat{\chapter}%
  {\huge\color{red}}% format applied to label+text
  {\llap{\colorbox{red}{\parbox{1.5cm}{{\hfill\itshape\huge\color{white}\thechapter}}}}}% label
  {2pt}% horizontal separation between label and title body
  {}% before the title body
  []% after the title body
  
\titleformat{\section}%
  {\normalfont\Large\itshape\color{orange}}% format applied to label+text
  {\llap{\colorbox{orange}{\parbox{1.5cm}{{\hfill\color{white}\thesection}}}}}% label
  {1em}% horizontal separation between label and title body
  {}% before the title body
  []% after the title body  
  
\titleformat{\subsection}%
  {\normalfont\large\itshape\color{blue}}% format applied to label+text
  {\llap{\colorbox{blue}{\parbox{1.5cm}{{\hfill\color{white}\thesubsection}}}}}% label
  {1em}% horizontal separation between label and title body
  {}% before the title body
  []% after the title body  
  
\begin{document}
\chapter{فصل}
\ptext[1]
\section{قسمت}
\ptext[1]
\subsection{ زیر قسمت}
\ptext[1]
\end{document}
