I suggest you go back to the excel spreadsheet. enter in all of the geometric information and see if the forward kinematics make sense. You will have to figure out for that offset what "a" or "d" values and apply to it (or add one, I am not an expert). once you have done that, verify when for example if j1=0 and j2 = -90 (link 1 vertical) and j3=90 (link 2 horizontal) j4 =0 j5 =0, does the X, Y and Z values correlate? meaning if your special J5 offset was zero, y would be 0, in your case for that joint condition, the Y value should be equal to the axis offset special to your robot. if that is OK, pay close attention to the calculation for the inverse kinematics columns OPQ rows 16-27. the J2 and J3 angles should be the same If there is an update needed, once you figure out the math in the excel, go to the section in the python code and find the section that has the math and update it. the variables of the names in the spreadsheet are the same used in the python code.