The issues you are describing are a common problem in the combination pdfLatex / chemnum / Texstudio / ChemDraw. The compound numbering is obviously very powerful in a chemistry thesis.
My answer bases on the answers to similar questions, see: Numbering/ChemDraw/Mac, EPS/ChemDraw/chemnum, correct Texstudio configuration,
I'll try to list in the following the most common sources of errors:
Compilation: you need to use pdflatex -synctex=1 -interaction=nonstopmode --shell-escape %.tex
in TexStudio
Texstudio PATH: Depending on your operating system, Set your PATH to something like /usr/local/texlive/2019/bin/x86_64-darwin:/Library/TeX/texbin
(you'll have to adapt depending on your OS).
Auto-pst-pdf: you'll need to load \usepackage[crop=off,runs=2]{auto-pst-pdf}
very early in your preamble.
EPS: It needs to be made in a way that Text strings are clearly defined as such. ChemDraw on Windows does it fine (standard parameters for export), but not ChemDraw on a Mac. This is a bug and a former question looked into it. Since I could compile your MWE I think you're fine.
I don't know about the jobname comment previously, I didn't need it for TexStudio but that might be necessary for Overleaf?
This example worked for me using the above described settings, using TexStudio v3:
\documentclass{article}
%\def\jobname{main} %<-- your file name
\usepackage[
runs=2,
crop=off
]{auto-pst-pdf}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{graphicx}
\title{Automatically numbering compounds in chemical schemes}
%% Uncomment these lines if you get error about "too many \new..."
% \let\tmp\newinsert
% \let\newinsert\newbox
\usepackage{chemstyle}
% \let\newinsert\tmp
\usepackage{chemnum}
% For positioning the scheme captions at the top.
%\floatsetup[scheme]{position=top}
\begin{document}
\begin{scheme}
%% hexa.eps has "TMP1" and "TMP2" as the markers
%% in fact EVERY .eps should start with TMP1, TMP2 etc
%% for ease of use
\replacecmpd{first:compound} %% automatically replace TMP1
\replacecmpd{second:compound} %% automatically replace TMP2
\includegraphics[width=\linewidth]{hexa}
\caption{This is something!}
\label{first:chem:scheme}
\end{scheme}
Compounds \refcmpd{first:compound} and \refcmpd{second:compound} in \ref{first:chem:scheme}. Here's a reference to in-text creation of \cmpd{RareCompound} that we can later refer to.
\vfill
\begin{scheme}
\replacecmpd{next:compound} %% automatically replace TMP1 BUT the autonumbering counter updates to 3!
\replacecmpd{last:compound} %% automatically replace TMP2
\includegraphics[width=\linewidth]{hexa}
\caption{This is something else!}
\label{second:chem:scheme}
\end{scheme}
Compounds \refcmpd{next:compound} and \refcmpd{last:compound} in \ref{second:chem:scheme}. Hey remember \cmpd{RareCompound}? \texttt{chemnum} still remembers it correctly, \emph{and} see how the compound numbering continues throughout the scheme diagrams!
\vfill
%% MANUAL UPDATING THE COMPOUND COUNTER; make sure you know what you're doing!
\setcounter{cmpdmain}{8}
\begin{scheme}
\replacecmpd{jumped:compound} %% automatically replace TMP1 BUT the autonumbering counter updates to 9!
\replacecmpd{nextjumped:compound} %% automatically replace TMP2
\includegraphics[width=\linewidth]{hexa}
\caption{This is again something else!}
\label{third:chem:scheme}
\end{scheme}
Compounds \refcmpd{jumped:compound} and \refcmpd{nextjumped:compound} in \ref{third:chem:scheme}. (Yes we manually modified the compound numbering counter after \ref{second:chem:scheme}).
\end{document}

PDFLaTeX
, add\usepackage{auto-pst-pdf}
to the preamble.auto-pst-pdf
)? What error message do you get? Did you create the.eps
file yourself? If so, could you open the eps file using an text editor and see if you can find "TMP1" there?