Welcome to Android Central! Which phone? Are you certain you saved those previous contacts to the SIM? SIM contact storage is pretty outdated technology, so could it be that you had saved those contacts to the Phone account storage instead (which is on Internal Storage)? If you did a factory reset, then those contacts would have been wiped out, assuming you didn't back them up anywhere.