Although you haven't tagged this question with pyqgis, you could achieve your goal by using the script below and pasting it into an editor in the python console and clicking run.
The field name mapping is set up in nested lists with the format:
[['Source field name', 'Target field name'], ['Source field name', 'Target field name']]
etc. and assigned to a variable. You can change the source and target field name in each internal list to suit your needs.
Then just make sure these two lines contain the actual names of your source and target layers.
layer_1 = project.mapLayersByName('Name of your source layer')[0]
layer_2 = project.mapLayersByName('Name of your target layer')[0]
The code will copy the selected features from layer_1, so make sure you have features selected before you run it. Alternatively, if you wish to copy all Layer_1 features, you can change this line:
L1_feats = [f for f in layer_1.selectedFeatures()]
to:
L1_feats = [f for f in layer_1.getFeatures()]
Complete code:
project = QgsProject().instance()
# Set up field mapping in lists below e.g. ['Layer A field name', 'Layer B field name']
fld_map = [['A1', 'B3'],
['A2', 'B5'],
['A3', 'B1'],
['A4', 'B4'],
['A5', 'B2']]
layer_1 = project.mapLayersByName('Layer A')[0] # change 'Layer A' to the name of your source layer
L1_feats = [f for f in layer_1.selectedFeatures()]
layer_2 = project.mapLayersByName('Layer B')[0] # change 'Layer B' to the name of your target layer
pr_2 = layer_2.dataProvider()
layer_2.startEditing()
for feat in L1_feats:
atts = {}
for item in fld_map:
atts[layer_2.fields().lookupField(item[1])]= feat.attribute(layer_1.fields().lookupField(item[0]))
L2_feat = QgsFeature()
L2_feat.setGeometry(feat.geometry())
pr_2.addFeature(L2_feat)
pr_2.changeAttributeValues({L2_feat.id(): atts})
layer_2.commitChanges()