output descriptor serialization
It looks like you are confusing the BIP 32 serialization with output descriptor serialization.
Output descriptors contain an extended public key serialized using the method described in BIP 32. This serialization applies only to that particular public key. The derivation appended to the end is independent and separate from that xpub's serialization. That is part of descriptors.


My question is for example for the second key: is the depth connected with the appended tail /0/0/*? If it is, shouldn't it be 2 instead of 1? Can depth be restored from the appended tail?


No. The tail is independent from the xpub. The depth applies only to the pubkey serialized by the xpub, which the derivation path is not a part of.


Why is the child index zero for the second key? Should it not be equal to the number that corresponds to the star. Can a child index be restored from the appended tail /0/0/*?


Because the serialization is only for that particular xpub. The appended derivation information is not part of this serialization.