Hi & welcome to this forum too,
@Crofton09 I think I said Hi to you over on GW.
Peat is organic matter (OM), and each type of peat is the same stuff regardless of brand. Gnats could as likely be breeding in a bag of 100% peat as in any potting soil, which is usually peat + a little perlite, or other mixes that have any kind of organic matter in them. For any of this kind of stuff, if the bag is opened and allowed to become dry after purchase, that should kill any gnats &/or larvae that might be living in there. Bags (any brand, with any kind of OM) that are stored outside and exposed to rain are more likely to have gnats in them than completely dry bags from inside. All it takes is one tiny hole for adults to be able to get in and lay eggs.
Scientists teach that fungus gnats thrive in peat, and what I have seen tracks along with that info:
https://ag.umass.edu/greenhous...
http://cues.cfans.umn.edu/old/...
http://umanitoba.ca/faculties/...
https://extension.colostate.ed...
https://gardenerdy.com/fungus-...
Articles about peat being unsustainable are numerous and concerning. I stopped using it before becoming aware of that aspect, and all of my plants are more happy without it.
@Plantani there are various products with BTi in them that, when added to your watering can, will kill the larvae in the soil of your plants, breaking the cycle and ending the infestation. BTi is a naturally occurring bacteria that is harmless to humans, pets, fish, birds.