Everything legally relevant has been said, but I wanted to briefly bring in another perspective:
Is the subcontractor for the electrical work or something else? Are all the works that fall into this area completed, or are there still further works that you will have to commission yourselves? I ask because, for example, with us, the rough-in electrical installation was completed before the insolvency of our developer, but the basement installation and fine installation were missing. We would have preferred to continue working with the old electrician, but he didn’t want to, and the new one swore a lot at times (partly because everything wasn’t labeled very well, so everything had to be traced through; partly also special quirks that the previous electrician had come up with, for which of course there was zero documentation; etc. etc.). I don’t know whether our electrician sometimes made things a bit difficult, but we were also advised on all sides beforehand: If possible, continue with the old one. (He just didn’t want to...)
Otherwise: that wasn’t the case with the electrician, but other subs also wanted to have invoices paid by us first. We had to reject that as well, but partially communicated a willingness to compromise (“we’ll find a solution”) especially with trades that might only have been half completed. I don’t know how much everything has been completed with you, but I just wanted to put that out there at least.