Using Lambda layers to take different slices of a prevous layer's output causes earlier Lambda layers to be overwritten
@sachinprasadhs I was able to replicate this issue on colab using [TFv2.13](https://colab.research.google.com/gist/sushreebarsa/290f255e733d113c7026e0827a77629b/62060.ipynb), [2.14](https://colab.research.google.com/gist/sushreebarsa/0f4eaed473ff891444fc54c5875b4f3c/62060.ipynb#scrollTo=V5-zf5sEd_DG) and tf-[nightly](https://colab.research.google.com/gist/sushreebarsa/03ea89c61270eec12cdda2c4b24778de/62060.ipynb). Please find the attached gits. Thank you! We will transfer this issue to keras org. Thanks @sachinprasadhs. I will close this issue now. Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/62060">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/62060">No</a>

### Issue type

Bug

### Have you reproduced the bug with TensorFlow Nightly?

No

### Source

binary

### TensorFlow version

2.10.0

### Custom code

No

### OS platform and distribution

Linux Ubuntu 22.04.3 LTS

### Mobile device

_No response_

### Python version

3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0]

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

I used two Lambda layers to extract slices from the same input vector. The output of the first Lambda is somehow overwritten by the output of the second Lambda.

Note: I have confirmed this happens whether the Lambda layers take the model's input directly or the output of another layer. I have also confirmed that the problem is present whether or not the Lambda layers are the direct outputs of the model. But for the sample code below I've removed the extra layers.

### Standalone code to reproduce the issue

```shell
import sys

import tensorflow as tf

print(f"{tf.version.VERSION=} {tf.version.GIT_VERSION=} {tf.version.COMPILER_VERSION=}")
print(f"{sys.version=}")

dividers = [0, 2, 5]

assert all(divider >= 0 for divider in dividers)
sizes = [end - start for start, end in zip(dividers[:-1], dividers[1:])]
assert all(size > 0 for size in sizes)
channels = dividers[-1]

i = tf.keras.layers.Input((channels,), name='i')
o = [
    tf.keras.layers.Lambda(lambda x: x[..., start:end],
                           name=f'slice_{start}_{end}')(i)
    for start, end in zip(dividers[:-1], dividers[1:])
]
m = tf.keras.Model(i, o, name='m')
m.build((channels,))
m.summary()
print(f"{m.input_shape=}")
print(f"{m.output_shape=}")
print(f"{m.compute_output_shape(m.input_shape)=}")
x = tf.zeros((1, channels))
print(f"{[y.shape for y in m(x)]=}")
print(f"{[y.shape for y in m.predict(x)]=}")
assert m.output_shape == m.compute_output_shape(m.input_shape)
```


### Relevant log output

```shell
tf.version.VERSION='2.10.0' tf.version.GIT_VERSION='v2.10.0-rc3-6-g359c3cdfc5f' tf.version.COMPILER_VERSION='9.3.1 20200408'
sys.version='3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0]'
Model: "m"
__________________________________________________________________________________________________
 Layer (type)                   Output Shape         Param #     Connected to                     
==================================================================================================
 i (InputLayer)                 [(None, 5)]          0           []                               
                                                                                                  
 slice_0_2 (Lambda)             (None, 2)            0           ['i[0][0]']                      
                                                                                                  
 slice_2_5 (Lambda)             (None, 3)            0           ['i[0][0]']                      
                                                                                                  
==================================================================================================
Total params: 0
Trainable params: 0
Non-trainable params: 0
__________________________________________________________________________________________________
m.input_shape=(None, 5)
m.output_shape=[(None, 2), (None, 3)]
m.compute_output_shape(m.input_shape)=[TensorShape([None, 3]), TensorShape([None, 3])]
[y.shape for y in m(x)]=[TensorShape([1, 3]), TensorShape([1, 3])]
1/1 [==============================] - 0s 286ms/step
[y.shape for y in m.predict(x)]=[(1, 3), (1, 3)]
Traceback (most recent call last):
  File "/home/hosford42/PycharmProjects/LSLAM/tf_bug.py", line 30, in <module>
    assert m.output_shape == m.compute_output_shape(m.input_shape)
AssertionError
```
