Using your code snippet I get the same output for this dummy example:
# Create dummy images
x = torch.zeros(4, 100, 100)
x[0, 25, :] = 1.
x[1, 75, :] = 1.
x[2, :, 25] = 1.
x[3, :, 75] = 1.

fig, axs = plt.subplots(2, 2, figsize=(24,8))
axs = axs.flat
for idx, i in enumerate(x.cpu().detach().numpy()):
    axs[idx].imshow(i, origin='lower', cmap='jet')
    axs[idx].axis('off')
fig.tight_layout()
fig.suptitle('Correct image', size=30)


x = x.transpose(-1,-2)
fig, axs = plt.subplots(2, 2, figsize=(24,8))
axs = axs.flat
for idx, i in enumerate(x.cpu().detach().numpy()):
    axs[idx].imshow(i.swapaxes(0,1), origin='lower', cmap='jet')
    axs[idx].axis('off')
    
fig.tight_layout()
fig.suptitle('Wrong image', size=30)