You are relatively safe on Copacabana Beach during the daylight when there are many people around, but your chances drop significantly lower when you visit the beach after dark. There is no reason for you to be on Copacabana Beach after dark (especially not recommended for solo travelers).