Sometimes, yes. Twice I’ve been offered roles that paid literally 2x my salary at that time (which was already pretty high), but did so because they knew the work was boring and they had trouble finding great engineers for it.
Sometimes, the salary gap is literally there because the work is that much less interesting, and whether it’s attractive or not depends on your values.