The intention behind this PR is to improve the example to aid the upcoming callback API guide. Also fixes #25823 Closes #36930 PiperOrigin-RevId: 644166441