Forget about partials for a minute, and consider this:
content/
└── p1.md
layouts/
├── foo.bar.html
├── foo.html
└── page.html
content/p1.md
---
title: p1
layout: foo.bar
---
Q: Which template will it use?
A: layouts/page.html
Q: Why doesn’t it use layouts/foo.bar.html?
A: Because the bar segment of the foo.bar.html file name is an invalid identifier; it is not a valid page kind, language, output format, etc. With an invalid identifier in the file name, this template is excluded from the list of possible matches.
Q: If bar is an invalid identifier, why doesn’t it just use layouts/foo.html?
A: Because you told it to use foo.bar.
Q: Why does it use page.html?
A: Because it’s a valid fallback.
If you wanted a custom template that you could call with the words foo and bar in the file name, use something other than a dot to separate them (e.g., foo-bar). The dot indicates separation of identifiers (page kind, language, output format, etc.) used in template lookups.