I am definitely missing something here.
I was expecting the input to the model to have 3 dimensions, but it only has 2.
Hmmm.
So train[0] has shape (batch_size, timesteps)
embeds has shape (batch_size, timesteps, emb_dim) which looks OK.
I really can’t see any reason why this would perform less well than the keras version.