ogr2ogr -f geojson \
-dialect sqlite \
-sql "select map.*,tbl.atrr from map left join 'tbl.csv'.tbl AS tbl on cast(map.id as text) = tbl.id" \
The casting is nececessary, but it has no sense to apply left join. It's an old bug http://osgeo-org.1560.x6.nabble.com/gdal-dev-ogr2ogr-strange-results-joininig-non-spatial-...
The problem could be related to your lyr.replaceDataSource assignments. The first argument should be pointing to the workspace, not the data or non-existing folder or existing folder without the right data in it. Previously you create your copy in GIS/shapefile/output but then you are looking for another folder, GIS/shapefile/output/Baseline, which might ...
Use the Field Calculator to copy the joined fields into permanent fields.
After doing the join, put the shapefile layer into edit mode.
Use the Field Calculator to copy the values from one of the joined fields into a new field.
Repeat step 2 for every joined field.
Save the layer edits.
I have a layer joined field called "emission lines_name". ...