It is a challenge to solve this one without creating (possibly a great number of) indicator grids, one per classification, and then carrying out a lot of expensive reclassifications and conditional calculations. Here's one way.
I interpret the question as asking to identify cells in which at most one of their eight neighbors has the same value as the cell itself. To do this we can inspect each neighbor for equality using tiny custom (but unweighted) neighborhoods. To minimize the amount of computation, we could (for instance) compute eight focal variety grids for the eight neighborhoods with shapes
1 0 0 0 1 0
0 1 0 0 1 0
0 0 0 0 0 0
and their four rotated equivalents.
For instance, here is a land cover image coded by color:

The eight focal variety grids (in grayscale, with white indicating higher values) look like

Recall that the output of a focal variety operation replaces each cell's value with the count of distinct values found in its neighborhood. We would therefore like to find cells where all, or all but one, of these focal variety counts equals 2. Such cells can readily be found by summing all eight focal variety results and comparing that sum to 8*2 - 1 = 15: when the sum equals or exceeds 15, we have found cells with too many different neighbors. (This procedure easily generalizes to identifying cells having at most k neighbors of their own type. The value of k can even vary, being specified on another grid.) This is the sum, shown on a "temperature" scale with orange representing high values:

The cells where the sum equals or exceeds 15 are shown in white in this indicator grid resulting from the comparison:

Handle border cells and any other occurrences of NoData by including NoData
as if it were just another cell classification (if necessary by first reclassifying NoData
to some unique non-null value).
To inspect the example more closely, let's zoom in to the upper left corner. I have recolored the classes to make them more distinguishable. The indicator is at the right: its white cells correspond to the original cells that have at most one neighbor with a value in common with them.

The total work involved is an optional reclassification of NoData, eight (tiny) focal variety calculations, a single local sum of eight grids, and a comparison. That is all sufficiently fast and simple that it should be preferable in any situation with more than about four different categories. It is nice, too, that the amount of work is independent of the categories: neither the number of different categories nor the individual category codes need to be known at all. That makes this solution available as a general-purpose, reusable tool.
Incidentally, if it is desired only to find cells all of whose neighbors have other values, there is a more expedient solution. Compute two focal varieties: one for the 3 by 3 neighborhood and another for the annular neighborhood in which the central cell is omitted. Select all cells where the former exceeds the latter: this is where including the central cell's value increases the number of distinct values found, showing that the central cell's value differs from those of all its neighbors. (How you deal with NoData values in this case is immaterial.)