It seems that in Moodle 4.3 (and up), the LTI behavior has been changed which affects the interaction with WeBWorK (in my case 2.18) -- unless I have been overlooking something fundamental...
In Moodle, LTI integration (both 1.1 and 1.3) is done via the External Tool plugin. This plugin allows to create a "preconfigured tool" for WeBWorK by the admin, and prior to Moodle 4.3 the instructor could then use this tool to connect to WeBWorK with the exact URL of a specific homework set or quiz on the respective WeBWorK server.
However, with Moodle 4.3 the textbox for the (exact) "Tool URL" has been removed from the settings page (technically, it is "hidden", see below). So, when I tried to setup the "External Tool" (respectively, the preconfigured WeBWorK tool) I couldn't find a way to specify the particular WeBWorK homework set anymore. Indeed, checking the Moodle forum, I found the following at https://moodle.org/mod/forum/discuss.php?d=454439:
Tools must now be set up prior to their use in a course. We no longer support manual configuration of a tool at the activity level, so this kind of on-the-fly tool instance creation isn't supported. So, regardless of whether the tool uses custom params or URL params to identify resources, it must be configured prior to its use.
So, in your case, the only 'solution' (it's not really feasible at scale) would be to configure these 'tools' (they are not really distinct tools in your case, but must be set up as such) and then use those tools via the activity chooser to create each link. Of course this gets messy quickly as the activity chooser fills up fast.
I did notice, however, that all connections between Moodle and WeBWorK (via LTI 1.1) setup before updating to Moodle 4.3 are still working, of course (or thankfully), and checking Moodle's database showed that the tool url could still be modified (using SQL, it is in the table mdl_lti) and thus be set to the homework set specific url there. In fact, the tool url textbox in Moodle 4.3 has only be "hidden", and so my current work-around (based on a similar suggestion in https://moodle.org/mod/forum/discuss.php?d=450974#p1825748 linked to in the above cited Moodle forum post) is to bring it back in Moodle by modifying the file moodle/mod/lti/mod_form.php.
At around line 440, I commented out the lines
This seems to work in my case (this code is taken from the github files of MOODLE_402_STABLE). However, I likely have to re-do it with every future Moodle update.
I hope this will help someone using LTI to connect Moodle and WeBWorK. Or maybe there is a better solution...