We explore the role that the obstacle position plays in the evacuation time of agents when leaving a room. To this end, we simulate a system of nonsymmetric spherocylinders that have a prescribed desired velocity and angular orientation. In this way, we reproduce the nonmonotonous dependence of the pedestrian flow rate on the obstacle distance to the door. For short distances, the obstacle delays the evacuation because the exit size is effectively reduced; i.e., the distance between the obstacle and the wall is smaller than the door width. By increasing the obstacle distance to the door, clogging is reduced leading to an optimal obstacle position (maximum flow rate) in agreement with results reported in numerical simulations of pedestrian evacuations and granular flows. For further locations, however, a counterintuitive behavior occurs as the flow rate values fall again below the one corresponding to the case without obstacle. Analyzing the head-times distribution, we evidence that this new feature is not linked to the formation of clogs, but is caused by a reduction of the efficiency of the agent's instantaneous flow rate when the exit is not blocked.