Slightly extending
dseligo's answer:
28A11407D6013C81 is 2927643256655264897 decimal number, however,
Integer can handle only numbers up to 2147483647. This way you are getting an overflow trying to fit a 128-bit number into a 32-bit integer.
Note that it won't fit into 64 bit integer either, so you'll have to get creative based on your specific usecase to have number this large to work. E.g. you may want to try https://www.freepascal.org/docs-html/rtl/sysutils/int128rec.html EDIT: I seem to be still sleepy, can't count characters right
Seems like the number is actually 64 bit, not 128. 16 half-bytes -> 8 bytes -> 64 bits. So no need in 128-bit integers.
A side note: it's always good to run in Debug mode while developing. This way such errors can be caught early. However, I'm not sure if
Hex2Dec https://www.freepascal.org/docs-html/rtl/strutils/hex2dec.html actually raises integer overflow error.