Flex doesn't require the app setting FUNCTIONS_WORKER_RUNTIME. In fact, you get an error when you run the Azure Functions: Upload Local Settings command on VSCode if your app is a Flex app.
Update the command to exclude that setting by default if app is hosted in Flex.