I’m not sure how Subaru codes work but I searched the VIN of a 2012 XV 2.0 diesel (Italian market) and it is JF1GPDLZ3CG018538. So should the code be GPD? I searched a XV 2.0 AWD too and it has GP7 in the VIN.
Yes, all 2.0L gasoline AWD models (regardless of Impreza or XV/Crosstrek) should be GP7. Japanese-market Impreza hatchbacks and XVs will display GP7 in the VIN, as cars built and sold in Japan don't follow the VIN format that is used outside of Japan.
As for the diesel XV, I don't think the VIN necessarily reflects the actual chassis code, as my personal 2017 Crosstrek's VIN contains GPA, while its build plate states GP7 as the chassis code. Can you try and find the build plate of the diesel model? It should look something like the photo below.