Probably because the tcpdump on your system is built with an older version of libpcap than your program. The tcpdump on your system is probably using a libpcap without this change:
commit 58275c05a5cf9c3512bcbb1192ff351d32ccccbd
Author: Guy Harris <guy@alum.mit.edu>
Date: Thu Sep 1 22:21:45 2011 -0700
Handle some amount of IPv6 fragmentation.
If we're checking for a particular protocol running on top of IPv6, and
we're not doing full protocol-chain chasing for all "running on top of
IPv6" tests, at least check for a fragmentation header before the header
for the protocol.
and your program is probably using a libpcap with that change. That change went into libpcap somewhere in the libpcap 1.3.x timeframe.