chrisma
Most gas stoves and fireplaces use a thermocouple which is a temperature sensitive switch that shuts off the flow of gas when it’s cold. This way, if the pilot light goes out for some reason, you don’t end up with a gas leak.
When we used to light up the gas stove for the winter, we always had to light it by holding a button that let the gas flow, and let it burn for 30 seconds or a minute until the thermocouple warmed up enough to allow the gas to keep flowing to the pilot.
Without a pilot light (and the gas main valve to the stove/fireplace turned on) the wall switch isn’t going to work. The wall switch would turn on the igniter for the main stove burner, which, of course, relies on the pilot light. So make sure your gas is turned on (usually there’s a handled turn valve to turn it on and off) and try keeping the pilot light burning for about 30 seconds and see if it will stay lit after that.
Just a guess on my part, but thought it might be helpful. Something you can try before calling in the professionals at professional rates.