The following command simply doesn’t work.

db.system.profile.remove({})

Firstly, turn off the profiling by setting its level to 0. Then you can simply drop the collection.

db.setProfilingLevel(0)
db.system.profile.drop()