Sishen wan (SSW) is utilized in the treatment of irritable bowel syndrome (IBS). This study aimed to compare gut microbiota-mediated metabolic profiles of potential toxicants derived from Psoraleae Fructus (PF) and Euodiae Fructus (EF) in mice. Data analysis was performed using ultra-high-performance liquid chromatography/ion mobility-quadrupole time-of-flight mass spectrometry (UHPLC/IM-QTOF-MS) coupled with an in-house in vivo MS2 spectral database. An increase was observed in the peak area of coumarin compounds, indicating their metabolic transformation was inhibited by intestinal flora following compatibility. Regarding flavonoids, Myristicae Semen (MyS) and EF suppressed gut microbiota-mediated transformation under normal conditions, whereas Schisandrae Chinensis Fructus (SCF) exerted ed the opposite effect. Under IBS conditions, MyS and Quefang (QF) inhibited gut microbiota-mediated transformation, while EF exhibited the opposite effect. The peak areas of alkaloids increased, whereas those of triterpenoids decreased, suggesting that compatibility prevented alkaloid transformation while promoting triterpenoid metabolism by gut microbiota. MyS and SCF enhanced the overall metabolism of PF, while EF exhibited an inhibitory effect. After compatibility, EF metabolites increased in normal mice but decreased in IBS mice. Compared to the normal state, IBS mice showed higher peak areas for all potentially toxic components, with lower metabolite quantities (expect for EF, which demonstrated the opposite effect). PF and its compatibility group predominantly underwent oxidation, hydration, and reduction metabolism, whereas EF and its compatibility group favored oxidation, methylation/demethylation, reduction, and hydration reactions. These results provide further insight into the chemical mechanisms underlying the "compatibility attenuation" effect of SSW.