after some debugging I’ve found the culprit, certain plugins unset FS_METHOD for some reason and my htdocs was group writable, that triggered the fallback from direct to ftpexton get_filesystem_method given that the its optional parameter allow_relaxed_file_ownership is false by default. See https://github.com/WordPress/wordpress-develop/blob/05a2999a8daf0da7e21ab94096578e6eb073bedf/src/wp-admin/includes/file.php#L2261 for more details on how WordPress tries to detect if the direct method is usable.