Try the following in order
Solution 1) go to Settings > General > IPhone Storage, find the update, it’ll be near the top of the list and click it and select delete update, then reboot your iPhone and go back to software updates in settings to retry both the download and installation of the software
Solution 2) visit https://updates.cdn-apple.com/2023SpringFCS/fullrestores/032-85359/91F3A33E-D8B2-4BFB-804E-7F64CE4A3BC3/iPhone13,1_16.5_20F66_Restore.ipsw
from your MacBook and do a IPSW update via finder, instructions can be found online to update iPhone via a direct ipsw file.
Holding the relevant key and clicking “update” will ensure no data loss occurs during the process.
Note the file to download is directly from Apple servers so it is official and genuine to download, no iPhone can be updated/restored via an IPSW that has been modified in any way shape or form to cause harm