That is because an sich is an adverbial of direction, and adverbials of direction belong into the predicate block. And that one is always at the end.
Ich habe gesehen, dass Müller im Strafraum den Ball nicht in das Tor schießen konnte.
Müller konnte im Strafraum den Ball nicht in das Tor schießen.
Müller schießt im Strafraum den Ball nicht in das Tor.
The adverbial of location (im Strafraum) precedes the noun accusative object (den Ball), as all "normal" adverbials (time, cause, mode, location) do. The adverbial of direction is special. It belongs to the predicate. It even moves with the predicate if you make it the topic of the main clause.
Nicht in das Tor schießen konnte Müller im Strafraum den Ball.
There is only ever one single item in front of the V2 verb. The full predicate block in this case.
(Of course you could also make only in das Tor the topic instead of the full predicate. That does not contradict the notion the directional adverbial is special as it can move together with the predicate.)
Dann bezahlte er und nahm die beiden Zaubertränke an sich.
Aber ich habe gesehen, dass er im Laden die beiden Zaubertränke nicht an sich nahm.
Same here.