A controller failing to update is most often the result of it being unable to properly connect to your console. The controller should usually be able to update over its Bluetooth connection, but a lot of different things can interfere with that connection, such as a low battery from the controller, electronic barriers, and interference from other Bluetooth devices. You can try to troubleshoot these problems one at a time, but one way to bypass all of these possible connectivity problems is to just connect it with a USB cable.
Not all USB cables are the same, however. Some of them uphold data exchange, while others only charge the controllers. To ensure that your DualSense can connect directly to the PS5 without relying on Bluetooth, you will need a data USB cable. The one that came with your PS5 should work, but some users have reported problems with this cable connecting properly.
You can attempt to connect a USB Type-A to USB Type-C cable to one of the USB ports on the front of your console, but several users have reported that they’ve had better luck using a Type-C to Type-C cable. This makes sense as the USB C port on the front of the PS5 supports up to 10 Gbps of data transfer, more than enough to handle a simple firmware update.