Fix KeyError returned by _maybe_get_last_node_only_observer (#58443)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/58443
Test Plan: arc lint
Reviewed By: vkuzo
Differential Revision: D28494119
fbshipit-source-id: 05abf4e12051afc237096812fb0ee08a8b9447f9