The Detectable Spells library version used by QP performs a clean-up operation on STATS.IDS that removes all duplicate entries. This causes compatibility issues with other mods because some entries have intentionally duplicate definitions in the EE games (same numeric value, different symbolic names). Some mods use these alternate symbolic names in their scripts and may fail to install if they are not found.
The problematic code can be found in the macro "reorder_stats_ids" in questpack/tp2/ds/ds.tph.