OP said error only happens on D<, not d<, which doesn't run on my machine.
However, here is a number for which the error occurs on 5.32 with d<
my $template = 'd<';
my $nv = 2.4;
$nv = 4135; # NOTE errors for this number
my $p = pack $template, $nv;
my $s = "'$p'";
system $^X, '-wle', "print unpack('H*', $s);";
Can't find string terminator "'" anywhere before EOF at -e line 1.
which shows that my guess that the pack produces a single quote character is plausible.