Bad positioning of element with Masonry layout filter

I’m trying for 2 days to make a filter system with the Masonry layout.

Here is my code : https://codesandbox.io/s/position-of-element-masonry-filter-kn4qi6

If I use the Justice’s filter, the layout is good, but with all other filters the elements have a bad positioning. They have free space to get a horizontal positionment but they keep vertical.

Can you help me please ?

Thanks you.