When you tell Hugo to cache a partial, it caches the result of the partial the first time the partial is rendered. You may call the partial from thousands of places, but it will only be rendered once.
If you have a conditional in the partial, the conditional is evaluated the first time the partial is rendered (see previous paragraph). In your case the conditional was evaluating the current section, which changes depending on the template from which you call the partial.
If you want to cache a partial per section (or per anything else), add a 3rd argument:
{{ partialCached "foo.html" CONTEXT KEY }}
This is covered in the documentation:
https://gohugo.io/functions/partialcached/