The main advantage of putting a space telescope like the Webb near the L2 Sun-Earth Lagrange point is that it's always relatively close to Earth, so comms signal strength is relatively high and uniform, and the signal travel time is fairly short.
We have put some science probes into heliocentric orbits, eg the current Parker Solar Probe, and STEREO, an earlier solar observatory mission consisting of a pair of spacecraft, with sidereal periods of 346 and 388 days.
One problem with heliocentric satellites is that it becomes hard to communicate with them when the line from the Earth to the satellite gets close to the line from the Earth to the Sun, and of course it's impossible to communicate with them directly when they're behind the Sun. Microwave beams pick up noise when they're in line with the Sun, due to the charged particles in the solar wind. Beams passing near the Sun are particularly affected, since there's a lot of electromagnetic activity close to the Sun, especially during times of intense solar flares, and coronal mass ejection events. We can partially deal with this problem by simply transmitting with more power, and/or reducing the bit-rate. It's simpler to just shut down when the solar noise gets too high, but even that strategy isn't foolproof.
Power in space isn't exactly free. Sure, in the inner Solar System, solar power is plentiful, but solar panels take up precious mass. The JWST has a power budget of one kilowatt, but its solar array can actually generate upto two kilowatts. The extra capacity is to compensate for the reduced efficiency as the solar panels age. Space isn't friendly on solar panels: they get hit by a lot more ultraviolet, as well as high energy solar & cosmic particles, and dust traveling at orbital speed.
Two kilowatts doesn't sound like a lot, but the Webb's panels are around 6 metres long. Here's a photo from NASA of those panels:

The Webb is around 1.53 million km from Earth, on average. Its distance varies between ~1.22 million km and ~1.76 million km. That's roughly 5 light-seconds. (The Earth-Moon distance is ~384,000 km). Here's a plot from last year, with a 3 day timestep, produced using JPL Horizons.

In contrast, for a satellite in a circular heliocentric orbit with (for example) a radius of 1.1 AU (~165 million km), the minimum distance between the satellite and the Earth is ~50 light-seconds, and the maximum distance is ~1050 light-seconds. It takes a lot more power to send a high bandwidth signal over those distances, and there's a huge variation in the signal delay, and in the signal strength.
Power systems are more robust when they're powering uniform loads. And it's wasteful to have a system with capacity to handle a large load if it's not using that capacity most of the time.
Incidentally, that 1.1 AU orbit has a sidereal period of ~433 days. But its synodic period, the time between its closest approaches to Earth, or when it's behind the Sun, is around 7.5 years.