The $3 \times 3$ lemma in the $\Sigma$-Mal’tsev and $\Sigma$-protomodular settings: Applications to monoids and quandles