As a consequence of https://gerrit.wikimedia.org/r/c/mediawiki/core/+/605185, which was for T229443, the {{SUBPAGENAME}} variable stopped returning the page title if the current page is not a subpage (this was also reported by @Soda at T229443#6272892). Quick comparison table for the value of {{SUBPAGENAME}}:
title | previous | current |
Foo/Bar | 'Bar' | 'Bar' |
Foo | 'Foo' | '' |
Judging from the task, this was not intentional, and it can (and does) break stuff on wiki (I've witnessed a report of a broken template), so the previous behaviour should be restored.