Note: including a lot of details to avoid XY problem.
Background
I have been dealing with a minor pest (psocids, in case you're wondering, but I don't want the conversation to become about that), mainly in a kitchen cupboard and the surrounding area. I've already taken a few appropriate steps, and the next step is to try to close various gaps that the bugs use to go through, such as the ones in the picture below at the back of the cupboard (I think they've nested somewhere behind there). I will be doing that with silicone sealant.
Problem
These bugs crawled everywhere, including the holes in the chipboard of the cupboard, which they seem to like. One such place where the chipboard is exposed, is the side of the shelves inside the cupboard.
I want to seal these sides to stop bugs from hiding in there and kill any bugs or eggs that are possibly still alive inside. I don't care much about appearance since these sides are out of sight, but a clear or white layer would be better.
I tried spreading a thin layer of silicone on one shelf, but this makes the shelf a bit "sticky" on the sides of the cupboard. This is not a huge problem since the shelves don't move regularly, but the silicone is coming off easily due to this "friction".
I thought to use some varnish instead, but then I saw a guy on Youtube (https://www.youtube.com/watch?v=FV-bLLVrakM) claiming that if I put plain varnish, I risk ruining the shelf by causing it to swell. He suggests "semi-transparent" (i.e., one that includes some paint), which I could not find on Screwfix or other places (UK). His interchangeable use of "varnish" and "stain" does not help either.
So, is it true that I should not use a varnish directly on the chipboard? If so, could I use a coat of paint directly and then varnish on top (since I can't find a mixed product)?