Is there any other way to fix this than completely factory resetting my phone?
Sorry, but no.
I do not know the old code nor the backup AppleId that was used.
Then, unfortunately you will not be able to factory reset the phone......because that requires that you enter the correct Apple ID Password as part of the reset process......no matter whether you are using a desktop, laptop or no computer.
Are you sure that you don't know the Apple ID Password? You would have used this multiple times to purchase apps or change certain settings on the phone.
If you really don't know the Apple ID Password.....and you are the original owner with a copy of the sales receipt for the phone........you can start an activation request with Apple. Here is the link:
start an Activation Lock support request.