As you are using softmax activation in the last layer, Your code is expecting Yt to be of size [500, 3] where as you are providing an array of size [500,3,5]. When I updated your code with that change, model trains without any error. Please note that the data I am using is only for demonstration.
Here 3 is a gist for reference. Thanks!
Check this example 3 for more details.