In GAP, how can I create a group isomorphic but not equal to a given group?

Sorry if the question title is confusing. Let me try to explain my question over an example. Please consider

gap> G := SmallGroup(24, 12);;

Without knowing that $G$ is $S_4$, can we define a new group which is $S_4$ but not equal to $G$. For example,

gap> H := SmallGroup(24, 12);;
gap> G = H;
false
gap> K := ShallowCopy(Group(GeneratorsOfGroup(G)));;
gap> K = G;
true

So I am trying to find a way to create a new group which has the same structure with $G$ without using SmallGroup. I used ShallowCopy to do that but I failed.

I want to do this, because if $S\leq G$, I cannot use the function IsConjugatorIsomorphism to see that whether a map is given by an element in S yet not in G. Since Parent(S) is $G$, it does not work. We can also use ConjugatorOfConjugatorIsomorphism to check that, but I would like to avoid doing this as I suspect there might be a simpler solution.

Edit. Another attempt that not helps me is below:

gap> S4 := SmallGroup(24, 12);;
gap> D8 := AllSubgroups(S4)[26];;
gap> StructureDescription(D8);
"D8"
gap> D8PermRep := Image(SmallerDegreePermutationRepresentation(
>                         Image(IsomorphismPermGroup(D8))));;
gap> center := Center(D8PermRep);
Group([ (1,3)(2,4) ])
gap> ConjugacyClassesSubgroups(D8PermRep);
[ Group( () )^G, Group( [ (2,4) ] )^G, Group( [ (1,3)(2,4) ] )^G,
  Group( [ (1,2)(3,4) ] )^G, Group( [ (1,3), (2,4) ] )^G, 
  Group( [ (1,2)(3,4), (1,3)(2,4) ] )^G, 
  Group( [ (1,4,3,2), (1,3)(2,4) ] )^G, 
  Group( [ (1,3), (2,4), (1,2)(3,4) ] )^G ]
gap> C2 := ConjugacyClassesSubgroups(D8PermRep)[4][1];
Group([ (1,2)(3,4) ])
gap> IsConjugatorIsomorphism(AllIsomorphisms(center, C2)[1]);
true
gap> Parent(C2) = S4;
false

Equality of groups can be difficult to define usefully, and GAP's answer can be hard to predict.

gap> G1 := Group([(1,2),(1,3,4)]);
Group([ (1,2), (1,3,4) ])
gap> G2 := Group([(2,3,4),(1,4)]);
Group([ (2,3,4), (1,4) ])
gap> G1 = G2;
true

Yes, because they are the same subgroup of $S_4$. But:

gap> G1 := SmallGroup(24,10);
<pc group of size 24 with 4 generators>
gap> G2 := SmallGroup(24,10);
<pc group of size 24 with 4 generators>
gap> G1 = G2;
false

Presumably each definition is constructing a separate object.


I'm not sure what the goal of creating an isomorphic (but not equal) group object is, but GAP seems to have a plethora of ways to do this. For example:

gap> G := SmallGroup(24,12);;
gap> Size(G);
24
gap> H := Group( (1,2,3,4), (1,2) );;
gap> Size(H);
24
gap> G = H;
false
gap> Iso := IsomorphismPermGroup(G);;
gap> K := Image(Iso);;
gap> Size(K);
24
gap> K = G;
false
gap> K = H;
false

Here we began with your way of constructing G as $S_4$, followed by constructing H as the familiar permutation group. Both are groups of order $24$, and GAP does not consider them to be equal.

We can further create the action-isomorphism object Iso and define the permutation group K which is the image of that mapping from G. Again we have a group of order $24$ which GAP does not consider to be equal to G nor equal to H.

Section 43.3 of the GAP reference manual may suggest to you something even closer to your intended purpose.