This can happen with some versions of Elementor and similar plugins as they interfere with wp-cli. There are new workarounds in 12.7.0
which releases in the next few days. In the meantime, downgrading the php version to get rid of the deprecated warning should work.