The test establishes a change stream cursor, which establishes the cursor on all shard primaries. The test then causes a failover on one of the shards, then asserts that it is able to continue using the cursor.
If the old shard primary goes through rollback as part of the failover (which happens nondeterministically since the test turns on the periodic noop writer on shards), all databases on that node will be closed and re-opened, which invalidates the change stream cursor and causes the test to fail when getMore is called on the cursor.