Quasi-normal mode theory of the scattering matrix, enforcing fundamental constraints for truncated expansions