I'm afraid your generative AI has let you down here. This QGIS processing algorithm ("native:joinattributestable") joins tables by one matching field only, and expects a string as the processing parameters for FIELD and FIELD_2. Your script is trying to provide a list of fields which is why it is failing.
An alternative would be to use geopandas to carry out the processing, you can still execute it in QGIS. You may need to install geopandas via OsGeo shell, then you can run this in the QGIS python console.
import geopandas as gpd
import pandas as pd
# User inputs
layer_a_path = "path/to/file"
layer_b_path = "path/to/file"
output_path = "path/to/destination"
fields_a = ["field1","field2"]
fields_b = ["field1","field2"]
# Processing
layer_a = gpd.read_file(layer_a_path) # Open layer 1
layer_b = gpd.read_file(layer_b_path) # Open layer 2
output = pd.merge(layer_a, layer_b, left_on=fields_a, right_on=fields_b)
gpd.GeoDataFrame(output, geometry="geometry_x").to_file(output_path)
# If executing in the QGIS python console, include the following
iface.addVectorLayer(output_path, "Output", "ogr")
If you'd rather work from a GUI, you could adapt your PyQGIS script to provide a GUI which captures user inputs but executes the processing part of the below code within the processAlgorithm() function.
A cleaner alternative would be to use a Virtual Layer as you suggest in your question, although I understand you aren't keen on this idea.