Tricky stacking models in keras
You can use the below type code.
import tensorflow as tf
from tensorflow.keras.layers import Input, Dense, LSTM, Concatenate
from tensorflow.keras.models import Model

# input of first NN
input_l1 = Input(shape=(2,))
out_l1 = Dense(1)(input_l1)

# input is 2nd NN
input_l2 = Input(shape=(2,))
out_l2 = Dense(1)(input_l2)

# concat layer output shape will be (None, 2) becuase we concatinated 2 dense layer outputs/ 
concat_vec = Concatenate()([out_l1, out_l2])

# we need 3d input to LSTM i.e. ( Batch_Size, no of time steps, feature space)
# We have 2 inputs so expanded dim to (None, 2, 1)
expanded_concat = tf.expand_dims(concat_vec, axis=2)

# LSTM
lstm_out = LSTM(15)(expanded_concat)

model = Model(inputs=[input_l1, input_l2], outputs=lstm_out)