This doesn't only change it for the returnto / returntoquery but for the entire context. We need to make sure that nothing assumes getTitle() on a SpecialPage is without par.
Although I haven't confirmed it yet, one of the things happening in RL2:
$title->equals( SpecialPage::getTitleFor( 'Gadgets' ) )
How does that behave if the title is Special:Gadgets/Foo ?
If you just want to check if this is any Gadgets page (including with or without a subpage), why not use $title->isSpecial( 'Gadgets' ) or the like?
Maybe there is a more specific fix just for this link. Though I don't see why SpecialPageFactory should be clobbering the title with $context->setTitle().
Maybe the idea was to have the subpage count as just a parameter to the special page, and the "real" title is the special page without the parameter.