Mental health beds cut over safety failures