We can almost factor the problem into the separate problems of determining the number $n_s$ of colourings on the square faces distinguishable under swapping and the number $n_r$ of colourings on the rectangular faces distinguishable under rotations about the prism axis. The only interaction between these two subproblems arises because if the square faces have the same colour, the colourings of the rectangular faces will behave differently depending on whether they are chiral, i.e. distinguishable from their mirror image. The product $n_sn_r$ counts a chiral colouring of the rectangles and its mirror image twice, even though they can be transformed into each other by swapping the square faces if those have the same colour, so we have to count the chiral and achiral colourings of the rectangles separately and compensate for the double-counting.
For $(4)$ identical colours on the rectangles, there is $1$ achiral pattern with $6$ colour choices.
For $(3,1)$ identical colours on the rectangles, there is $1$ achiral pattern with $6\cdot5$ colour choices.
For $(2,2)$ identical colours on the rectangles, there are $2$ achiral patterns with $\binom62$ colour choices each.
For $(2,1,1)$ identical colours on the rectangles, there is $1$ achiral pattern with $6\binom52$ colour choices and $1$ chiral pattern with $6\cdot5\cdot4$ colour choices.
For $(1,1,1,1)$ identical colours on the rectangles, there is $1$ chiral pattern with $6\cdot5\cdot4\cdot3/4$ colour choices.
Each of the achiral colourings of the rectangles can be combined with $\binom62+6$ colourings of the square faces, whereas for the chiral colourings of the rectangles the $6$ colourings of the square faces with identical colours are double-counted, so to compensate we should count only $\binom62+3$ colourings of the square faces per chiral colouring of the rectangles.
Putting it all together, we have $6+6\cdot5+2\binom62+6\binom52=126$ achiral colourings of the rectangles with $\binom62+6=21$ colourings of the square faces and $6\cdot5\cdot4+6\cdot5\cdot4\cdot3/4=210$ chiral colourings of the rectangles with $\binom62+3=18$ colourings of the square faces, for a total of $126\cdot21+210\cdot18=6426$ distinguishable colourings of the prism.
Now comes the weird part. The answer given in the book leads to $6246$, with just two digits swapped. But if you correct the error you spotted, you only get $6381$. The reason is yet another error -- the number for "swap ends, as above, rotate $90°$ or $270°$" that Gerry corrected from $6^4$ to $6^2$ should in fact be $6^3$, since this operation swaps two pairs of adjacent rectangles into each other. That makes the total come out right to $6426$.
P.S.: Oddly enough, your typo made the number in your original post come out right, since the overall result of the three errors was just that the numbers in the last two lines were swapped :-). What's also odd is that the "Instructor's Solutions Manual" for the 7th edition that I found online contains the incorrect solution you quote, whereas the Spanish edition that you can also find online, which seems to be from 1988 and thus older than the 7th English edition, doesn't give a detailed solution, but gives the correct number $6426$ in the solutions section.
Case $n=6$: Colour one side with the ugliest colour, and put the cube on a table ugly side down. There are $5$ choices for the colour on top. For each of these choices, colour the side facing you with the nicest remaining colour. The last three sides can be coloured in $3!$ ways, so the number of colourings is $(5)(3!)$.
Case $n>6$: First choose the colours, then use them. The number of colourings is
$$\binom{n}{6}(5)(3!).$$
Best Answer
There is an algorithmic approach to this which I include for future reference and which consists in using Burnside and Stirling numbers of the second kind. For Burnside we need the cycle index of the face permutation group of the cube. We enumerate the constituent permutations in turn. First there is the identity for a contribution of $$a_1^6.$$
Rotating about one of the four diagonals by $120$ degrees and $240$ degrees we get
$$4\times 2a_3^2.$$
Rotating about an axis passing through opposite faces by $90$ degrees and by $270$ degrees we get
$$3\times 2 a_1^2 a_4$$
and by $180$ degrees
$$3\times a_1^2 a_2^2.$$
Finally rotating about an exis passing through opposite edges yields
$$6\times a_2^3.$$
We thus get the cycle index
$$Z(G) = \frac{1}{24} (a_1^6 + 8 a_3^2 + 6 a_1^2 a_4 + 3 a_1^2 a_2^2 + 6 a_2^3).$$
As a sanity check we use this to compute the number of colorings with at most $N$ colors and obtain
$$\frac{1}{24}(N^6 + 8 N^2 + 12 N^3 + 3 N^4).$$
This gives the sequence
$$1, 10, 57, 240, 800, 2226, 5390, 11712, 23355, 43450, \ldots$$
which is OEIS A047780 which looks to be correct. Now if we are coloring with $M$ colors where all $M$ colors have to be present we must partition the cycles of the entries of the cycle index into a set partition of $M$ non-empty sets. We thus obtain
$$\frac{M!}{24} \left({6\brace M} + 8 {2\brace M} + 12 {3\brace M} + 3{4\brace M}\right).$$
This yields the finite sequence (finite because the cube can be painted with at most six different colors):
$$1, 8, 30, 68, 75, 30, 0, \ldots$$
In particular the value for four colors is $68.$ We also get $6!/24 = 30$ for six colors because all orbits have the same size.