The problem is the protocol that you want to encapsulate
pppHeader->setProtocol, this must have the encapsulate protocol,
if you use ProtocolGroup::pppprotocol.getProtocolNumber, the valid protocols that can be encapsulate must be
{ 0x0021, &Protocol::ipv4 },
{ 0x0057, &Protocol::ipv6 },
{ 0x0281, &Protocol::mpls },
{ 0x39FC, &Protocol::flooding }, // INET specific non-standard protocol
{ 0x39FD, &Protocol::probabilistic }, // INET specific non-standard protocol
{ 0x39FE, &Protocol::wiseRoute }, // INET specific non-standard protocol
{ 0x39FF, &Protocol::nextHopForwarding }, // INET specific non-standard protocol
You try to encapsulate ppp over ppp, and this is forbidden.
In your case, the UPF and gNB, should include the tag with the protocol that they are using, packet->addTagIfabsent<PacketProtocolTag>() with the protocol. If the protocol is different of ipv4, ipv6, mpls, flooding ....., you will need to include it in the
table "ProtocolGroup::pppprotocol.getProtocolNumber"