You have the following architecture:
Model: "sequential"
_________________________________________________________________
Layer (type)                 Output Shape              Param #   
=================================================================
lstm (LSTM)                  (None, 3, 32)             4352      
_________________________________________________________________
dense (Dense)                (None, 3, 1)              33        
=================================================================
Total params: 4,385
Trainable params: 4,385
Non-trainable params: 0
_________________________________________________________________

If I feed one tensor created with your code in the model:
train_set = iter(train_set)
batch = next(train_set)
out = model(batch[0])

you will get the warning:
WARNING:tensorflow:Model was constructed with shape (None, 3, 1) for input KerasTensor(type_spec=TensorSpec(shape=(None, 3, 1), dtype=tf.float32, name='lstm_1_input'), name='lstm_1_input', description="created by layer 'lstm_1_input'"), but it was called on an input with incompatible shape (32, 5, 1)

therefore your model is only considering 3 time steps from the 5 you are feeding, have a look here:How to Reshape Input Data for Long Short-Term Memory Networks in Keras 3 ,  this this could help you to understand the input logic in LSTM models