Switches will learn source MAC addresses from any Ethernet frame. The problem here, is that SW2 is unable to learn H1’s MAC address and SW1 is unable to learn H2’s MAC address.
When H1 replies with an ICMP reply, it will send it to SW1 (its default gateway) in VLAN 10.
SW1 receives it in VLAN 10, routes it and decides to forward it to VLAN 20. It builds a new Ethernet frame with its own MAC address as the source.
That’s the key to this problem…SW2 will never learn the source MAC address of H1 since SW1 inserts its own MAC address as the source. It never sees the MAC address of H1. The only time it was able to learn it was the first ARP, since that is a broadcast frame…
Does that make sense?