@Jewlry you can sort this all out quite simply, but you do need to listen to advice.
Presumably, job 1 and job 2 are different. Job 2 meets the criteria that the doctor stated on your previous fit notes? Therefore, what you can do is go to the doctor and ask for a fit note that covers you for the period until 30th October (they are allowed to back date it to the date that your last one ran out if they have been seeing you regularly). Ask them to tick the amended duties box and state that you are fit to do x,y,z duties, but not a,b,c as they have done in the past.
Then write to your job 1 employer, stating that you apologise for resigning with immediate effect, but thought that your previous discussion with HR had indicated that this would be acceptable,
as you were on long term sick leave. However, you retract that resignation, and instead give the four weeks notice, ending on 30th October. Unfortunately, you remain unfit for the role and will be signed off as unfit for the duration of your notice period. As with the other fit notes, the doctor has noted duties which S/he feels you are fit for, and as a courtesy, you would like to inform them that you have secured a role which fulfills these criteria.
You would like to that x company for their support during such and such a time, and you wish them well for the future.