This error says that it’s impossible to compare targets that have shape (None, 1) and model output that has shape (None, 9, 128). None stands for batch dimension. You can ignore it. All the rest is what you define and pass to the model.
In a classification model the final dense layer should have the number of units equal to the number of classes. I suspect that 128 is not a number of classes but arbitrarily chosen number of units.
Output shape (None, 9, 128) means that you need to add Flatten before the final Dense layer. It will eliminate 9.
When the targets are in a sparse format (they are not one-hot encoded and represent just one column with different labels), the loss should be SparseCategoricalCrossentropy.