Fix Resource#stage method signature in debug mode

Fixes #27554.