I was in CDMX and I felt safer there than many places around the world. What you described is common among any city in the world. I was never witnessed or encountered any those things that you described but as a US citizen living in the US, in Atlanta, GA, I was followed for a mile before I was approached by the culprits. I was a law enforcement officer at the time and I surprised them with a 40. That occurred in the US and I felt safer in CDMX than ATL.
NYC is one of the safest cities in the U.S. Crime is low and Queens, Brooklyn and Bronx is heavily gentrified. It is no longer the NYC from the early 2000's