Reading the above verses together, one reaches at the conclusion that God cannot work miracles on us without our consent.
The Plain Correct Conclusion (as I see it)
Plain reading of these texts [where one always needs to begin in accordance with Church's rules for biblical interpretation] is that it was because of their unbelief/lack of faith in him that the LORD did not did not do [many] mighty works there.
Therefore the LORD did some but not as many as he would have wanted to perform had they had belief/faith in him. Therefore it is safe to conclude just from these texts that lack of unbelief/lack of faith cannot stop the LORD from working miracles to achieve his purposes, even while noting from the rest of the scriptures that the belief and faith in him from those who ought to believe in and have faith in him is very BIG with the LORD. Scripture has examples of the LORD requiring or encouraging faith before he performs a miracle.
Catholic doctrine taught by early Church Fathers especially St. Augustine being pre-eminent in this matter is that:
God's rule is absolute over men's wills by [virtue] of His omnipotence
and omniscience - through the infinite store, as it were, of motives
which He has had at His disposal from all eternity, and by the
foreknowledge of those to which the will of each human being would
freely consent. - Cf. Free Will | New Advent.
The way I explain this to myself is that as regards God and those who make themselves his enemies, if they were playing chess, God has infinite moves he can make and he knows beforehand ALL the moves his enemies will make. Actually, from the nature of infinity, he has infinite moves for each move of his enemies. He can't lose.
Whatever the LORD pleases he does,
in heaven and on earth,
in the seas and all deeps. - Ps 135:6 (RSVCE)
Therefore even if unbelief/lack of faith in him on the part of those who ought to believe might at quick glance appear to be a hindrance to God performing miracles, if he wanted to perform the miracle for his glory and the good of men, he will find a way to work that miracle.
One Old Testament example that comes to mind is the Massah and Meribah incident.