Tangential (and not my area of expertise), but I do know that the Ingenuity helicopter uses an off-the-shelf Snapdragon 801 SoC. As I understand it that is very unusual for any projects like this, let alone something like the JWST.
In essense, using more off the shelf parts for the Mars rovers is part of the science experiment.
Pathfinder cost <$300M. “Better cheaper faster” became Discovery class missions, “capped” at $500M. Curiosity and Perseverance cost about $2.5B each. Not in the same category.