fromPointXY
creates a new geometry from a QgsPointXY
object which is a tuple withcreated by providing two float coordinates, i.e. "X"
and "Y"
.
So, try the following expression:
feat.setGeometry(QgsGeometry.fromPointXY(QgsPointXY(coords[0], coords[1])))