So you're using free5gc (hence stuck on linux 5.0.0-23-generic) and want to use wireguard VPN.
tl;dr you need wireguard-linux-compat tag v1.0.20200520
git clone https://git.zx2c4.com/wireguard-linux-compat
cd wireguard-linux-compat
git checkout v1.0.20200520
cd ..
make -C wireguard-linux-compat/src -j$(nproc)
make -C wireguard-linux-compat/src -j$(nproc) install