I'm sure there are a few different ways to do this. It's just a matter of stitching together the correct Sharepoint paths.
Below is a working example of one method.
I've replicated as much of your flow as possible and everything's dynamic. Referencing this example should do the trick.
Here are the outputs from my testing. Dynamic SP folders with dynamic word and pdf files. All content is accurate.
STEPS BELOW1-3. A replication of your flow. Note the content references from the action outputs. Just mirror these in your flow. Play close attention to the forward slashes.

4. Sharepoint create file action to make the PDF.
5. Reference the Word Doc name but replace the extension for the PDF file. using this formula:
replace(outputs('Create_Word_Doc')?['body/Name'],'.docx','.pdf')

I'm sure there are a few different ways to do this. It's just a matter of stitching together the correct Sharepoint paths.Below is a working example of one method.I've replicated as much of your flow as possible and everything's dynamic. Referencing this example should do the trick.Here are the outputs from my testing. Dynamic SP folders with dynamic word and pdf files. All content is accurate.STEPS BELOW1-3. A replication of your flow. Note the content references from the action outputs. Just mirror these in your flow. Play close attention to the forward slashes.4. Sharepoint create file action to make the PDF.5. Reference the Word Doc name but replace the extension for the PDF file. using this formula:replace(outputs('Create_Word_Doc')?['body/Name'],'.docx','.pdf')