Fix was that in VScode the "ports" section had been removed somehow and probably in troubleshooting attempts I never had the right combination of settings. But eventually setting:
if __name__ == "__main__":
app.run(debug=True, port="5000")
AND configuring port 5000 in the 'ports' section of vscode, did the trick