Penalty functions for combining coupled-cluster and perturbation amplitudes in local correlation methods with optimized orbitals