This used to be possible, but is no longer possible with recent versions of Hugo. See this thread for more discussion (and a test case). At this time, I haven’t seen any official statement on whether this is an intentional change or a regression.
I don’t remember exactly when this change occurred. I first encountered it with Hugo 0.57 or thereabouts; if you want to drop back to an earlier Hugo version to fix your site, you’ll need to go at least that far back.