Update reference's internal item after inserting reference

This fails before the reference has been inserted, because
it's not yet in keyedNodes at that point.

Bug: 63031
Change-Id: I34ea1a88c0f332c23e43597d1c42158bfb0f1e98