for reason unknown, the failure happens as expected...

...if one adds a call to chain.GetEntries() prior to looping.