Hey there Findmyiphonehelpme,
The first thing we wanted to make sure you had were the next steps to take as your iPhone was stolen: If your iPhone, iPad, or iPod touch is lost or stolen
Regarding your question about erasing it, there are some finer details in step 5 of the article. As the details in this step points out, if you have iOS 15 or later installed on your iPhone, you can still use Find My to locate it, or play a sound on it. If you had an older iOS version installed, and you erased it, then you wouldn't be able to use those two aforementioned features.
With the above details in mind, we still recommend taking all of the remaining steps(if you haven't yet) from the above article as recommended by Apple.
Cheers!