When the distance between the end of the item and the edge of the time selection is very small (several samples long), "glue within time selection" which is actually action 42432 does not fill in the gap with silence.
When making the item smaller, which in turn makes the
gap between its edge and the time selection edge wider, it works as expected.
Here's a gif demonstrating this behavior: