Narrow field telescopes such as HST or JWST are basically never randomly pointed - the field of view and density of interesting objects is not high enough that this would be viable and such a proposal would never make it out of the Time Allocation Committee as a valid use of precious and expensive telescope time.
Looking at page 586 ("ASTRO-13") of the NASA FY23 Budget Request we can see that Hubble and JWST are \$98.3 and \$187 million a year to operate (I took the FY24 numbers as a "steady state" for JWST). From a report to the Space Telescope User Committee, we can find that Hubble executes about 75 orbits (each ~95 minutes) of observations per week in recent Cycles, making the cost per orbit about \$25k or about \$16k/hour to operate. I don't have similar numbers for JWST and being out at L2 makes operations a little easier, but it's also newer and operations won't be as streamlined as they are for Hubble, but given the budgets, we can assume ~2x Hubble so \$32k/hour.
Oversubscription rates vary by cycle, science program category and instrument but approx. people ask for four times as much time on Hubble as is available and the selection rate for proposals is about 20%. So 80% of the people who apply with detailed science and observing plans for what they want to do get nothing and no observing time. Given this oversubscription rate, if you propose to randomly point the telescope and have no idea what you're going to see and whether it will produce anything to justify the time spent, your proposal will get a very low grade and zero time awarded.
Blind/random discovery is not the job of precision instruments such as HST or JWST; that's what sky surveys are for. These will tile a substantial fraction of the sky with an instrument that has a large field of view in a single exposure, usually in only 1 or maybe 2 filters and often for a specific science goals such as discovering Near Earth Objects (e.g. ATLAS) or supernovae/explosive transients (e.g. ZTF or ASAS-SN) but can also be a general purpose survey with a variety of science goals (e.g. Sloan Digital Sky Survey (SDSS)). These surveys will find large numbers of new examples of known objects which weren't their primary science goal (e.g. new eclipsing binaries found in the OGLE survey for microlensing events Udalski et al. 1994. Occasionally, entirely new classes of object will be found of which the most famous example is Hanny's Voorwerp found in Galaxy Zoo images. These new objects or a subset e.g. "we'll pick the 10 best eclipsing binary candidates from our survey for further study" can then be studied in detail using larger 4-8m telescopes or space assets like HST and JWST.
This model of "small widefield telescope finding interesting objects for big telescopes" dates back to the original 48"/1.2m Samuel Oschin Schmidt and the Palomar Observatory Sky Survey at Palomar Observatory which surveyed the Northern Sky using photographic plates in two "filters" (emulsions) in part to find and feed interesting targets to the 200"/5m Hale telescope. This was replicated in the Southern Hemisphere with the near-identical UK Schmidt and ESO Schmidt Telescopes and has continued through digital CCD surveys such as SDSS, PanSTARRS and SkyMapper as well as the ATLAS, ZTF and ASAS-SN previously mentioned. This model of "wide and shallow survey first, narrow and deep follow-up later" is more efficient in use of the telescope time and produces a better and higher science return per hour/dollar.
(The closest HST comes to random pointings is the Pure Parallel mode where you can use a different instrument to observe an adjacent field close to where the main prime program and instrument is observing. The pure parallel mode gives you no control over where you look and for how long; that is totally set by the prime program and given the many pointing restrictions, the extremely small amount of sky covered by Hubble per year and the types of targets Hubble tends to observe, this is very far from "random" pointings)