Contrast specified for fMRI is producing flawed output

Hey all,
I am a newbie in fMRI analysis and currently processing a task-based fMRI dataset for my master’s project. I have preprocessed the data using fMRIprep and denoised it using nilearn.

My task has two conditions, A and B. The contrasts I had setup are as follows:
A - 0
0 - B
A - B
B - A
The idea was to get regions specifically coding for condition A (A-B) and regions that might be involved in both A and B (A - 0). I had an educated guess that the contrast condition A-B would have lesser regions than A-0 as I am getting rid of any regions that might otherwise be involved in both conditions!

Unfortunately, I seem to have more regions popping up in the A-B condition than A-0 for all participants. I am 99% sure that it is due to some error in my code, but I seem to be unable to find any errors so far.


fwhm=4
  
base_dir = '/home/austin/Documents/processed_data/bids_music/analysis/fmriprep_6dof'

file_list = sorted([x for x in glob.glob(os.path.join(base_dir, '*/func/',f'*nilearn_denoise_smooth{fwhm}mm_task-music_space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz'))])

sub_dict = {}

for i,f in enumerate(file_list):    

    sub = os.path.basename(f).split('_')[0]
    print('The following subject data is being processed:',sub)
    
    neuroData = nib.load(f)
    
    dm = dm_dict[i]
    
    # compute a whole brain mask, voxels within this mask will be denoised and extracted.
    #brain_mask = compute_brain_mask(neuroData, mask_type='whole-brain', threshold = 0.08)
    
    ## Using an MNI152 brain mask to potentially remove the error caused in fslmeants due to differeing sizes of nifti and mask
    
    #brain_mask = mni_mask(resolution=2) #still throwing error
    
    brain_mask = nib.load('/home/austin/fsl/data/standard/MNI152_T1_2mm_brain_mask.nii.gz')
    
    glm_model = FirstLevelModel(t_r = 1.2, hrf_model='glover', mask_img=brain_mask)
    glm_model = glm_model.fit(neuroData, design_matrices = dm)
    
    print("Creating a constrast matrix")
    
    contrast_matrix = np.eye(dm.shape[1])
    
    basic_constrats = {
        column: contrast_matrix[i]
        for i, column in enumerate(dm.columns)
        }
    
    contrasts = {
        "Acc" : basic_constrats["A"],
        "NoAc": basic_constrats["NA"],
        "A-NA": basic_constrats["A"] - basic_constrats["NA"],
        "NA-A": basic_constrats["NA"] - basic_constrats["A"],
        "Both": np.vstack((basic_constrats["A"], basic_constrats["NA"]))
        }
    
    print(f"Computing constrasts for subject: {sub}")
    
    for contrast_id, contrast_val in contrasts.items():
        print(f"\tcontrast id: {contrast_id}")
        # compute the contrasts
        #z_map = glm_model.compute_contrast(contrast_val, output_type="z_score")
        sub_map = glm_model.compute_contrast(contrast_val, output_type='all')
        sub_dict[sub+':'+contrast_id] = sub_map 

for j in range(23):
    for key,data in sub_dict.items():
        if f"{j}".zfill(2) in key:
            z_map = sub_dict[key]['z_score']
            
            beta_map = sub_dict[key]['effect_size']
            
            pThresh = nilearn.glm.threshold_stats_img(z_map, height_control = 'fdr', alpha = 0.005, cluster_threshold=10)[0]
            
            pMask = math_img("img1*img2", img1 = binarize_img(pThresh), img2 = pThresh, copy_header_from = 'img2') #Final pVal mask
            
            FinImg = math_img("img1*img2", img1 = beta_map, img2 = pMask, copy_header_from = 'img1')
            
            
            nib.save(FinImg, f'/home/austin/Documents/bids_music/analysis/fmriprep_6dof/zmap_AVNA_FSLMNI/pThresh/{key}_pThresh_zmap.nii.gz')

I am running all of my code on spyder in a virtual environment created within anaconda with nilearn and other packages installed within the environment.

The aim of the GLM was to find the regions that are specifically coding for condition A for further analysis. Any inputs on whether there is an issue in my understanding of the technique or if there is an error in the code would be welcome!
Thanks in advance!!