You should look at the streaming operator to convert members of a class to an integral variable (pack) and back (unpack). Assuming p has a handle to a class object with the same member names as your struct:
i = {>>{p.data,p.address,p.source,p.counter,p.failure}}; //pack
{>>{p.data,p.address,p.source,p.counter,p.failure}} = i; //unpack
The code that you showed should have failed in both directions. You cannot make an assignment between packed and unpacked types without a cast.
typedef logic [$bits(Packed_packet)-1:0] temp_t;
temp_t i;
Packed_packet packet1;
Packed_packet packet2;
assign i = temp_t'(packet1);
assign packet2 = Packed_packet'(i);