I don't think finding tangent connected edges will work in this case because you've got some corners that are not tangentially connected. The sketch is also quite messy with a lot of overlapping geometry. When I run the command and select the outline, the preview will change depending on the mouse's location, even when moving over the same line. When I looked closer, it wasn't a single line but four sketch lines on top of each other. This makes the "correct" result ambiguous because there are many possible "correct" answers. I was able to get a similar result from the API that I was getting with the command using the simple test program below, but it's difficult to say this is the desired result because there is more than one "correct" result.
def SimplePatchTest():
try:
app = adsk.core.Application.get()
ui = app.userInterface
des = adsk.fusion.Design.cast(_app.activeProduct)
root = des.rootComponent
skCurve = _ui.selectEntity('Select a sketch curve.', 'SketchCurves').entity
patchInput = root.features.patchFeatures.createInput(skCurve, adsk.fusion.FeatureOperations.NewBodyFeatureOperation)
patch = root.features.patchFeatures.add(patchInput)
except:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
Here's the result I got with the script above when selecting the highlighted line.

---------------------------------------------------------------
Brian EkinsInventor and Fusion 360 API Expert
Website/Blog:
https://EkinsSolutions.com