Check if id is already ObjectId before trying to convert.