Is a t-test suitable to compare the difference between the mean z-scores of two groups I have a group, people, and have converted their heights into z-scores.
I separated the groups into male and female and wanted to test whether there is a statistically significant difference between the groups. Is a t-test suitable for this purpose?
The means and SDs of the groups are not identical because the z-score was calculated on the whole group.

In short, yes. As long as you converted the heights to z-scores before splitting them into groups, then it is valid to perform a t-test. Z-scoring as you have described it is sometimes referred to as "standardizing" data, and it is a common preprocessing step in many analysis pipelines. This is because the calculated effect size will be in units of SD, instead of inches, which can sometimes be useful.
