Hello
I can reproduce on actual 9.6.6, 10.1 and fresh master build (9c7d06d60680c7f00d931233873dee81fdb311c6 commit). I did not check earlier versions
set enable_indexonlyscan to off ;
postgres=# SELECT w FROM words WHERE w LIKE '%e%';
w
-------
Lorem
Index scan result is correct. Affected only index only scan,
PS: i find GIST(w gist_trgm_ops, w); some strange idea, but result is incorrect in any case.
best regards, Sergei