mysql 5.7 – How to properly cut/filter binlog file to perform single table PIT?

I’ve been trying to perform a single table PIT.

After cutting off a dump the portion related to the table I want to restore in time, I’ve been trying to do a similar operation with the binlog file isolating first, the period of time of interest and then, the parts related to the specific table.

Regarding “the parts” I think that here lies the source of error that I get when trying to apply the extracted portion of binlog that is:

ERROR 1609 (HY000) at line 8: The BINLOG statement of type 
Table_map was not preceded by a format description BINLOG 
statement.

My shaped binlog file, looks like this:

/!/;
# at 291
#201227 10:20:01 server id 1  end_log_pos 365 CRC32 
0x7bd7d7b7  Table_map: agef.tabelladiprova_pet mapped to 
number 199
# at 365
#201227 10:20:01 server id 1  end_log_pos 423 CRC32 
0xcd6cb3d7  Write_rows: table id 199 flags: STMT_END_F

BINLOG '
(long string here)
'/!/;
# at 423
#201227 10:20:01 server id 1  end_log_pos 454 CRC32 
0x78e6af69  Xid = 167
COMMIT/!/;
# at 454
#201227 10:21:02 server id 1  end_log_pos 519 CRC32 
0x4ee9d99e  Anonymous_GTID  last_committed=1        
sequence_number=2    rbr_only=yes
/!50718 SET TRANSACTION ISOLATION LEVEL READ COMMITTED//!/;
SET @@SESSION.GTID_NEXT= 'ANONYMOUS'/!/;
# at 519
#201227 10:21:02 server id 1  end_log_pos 591 CRC32 
0x7487c643  Query   thread_id=2     exec_time=0     
error_code=0
SET TIMESTAMP=1609060862/!/;


/!/;
# at 591
#201227 10:21:02 server id 1  end_log_pos 665 CRC32 
0x201999c0  Table_map: agef.tabelladiprova_pet mapped to 
number 199
# at 665
#201227 10:21:02 server id 1  end_log_pos 719 CRC32 
0xa4a6e21d  Write_rows: table id 199 flags: STMT_END_F

BINLOG '
(long string here)
'/!/;
# at 719
#201227 10:21:02 server id 1  end_log_pos 750 CRC32 
0x10fbda16  Xid = 168
COMMIT/!/;
# at 750
#201227 10:21:34 server id 1  end_log_pos 815 CRC32 
0x33a1e7bf  Anonymous_GTID  last_committed=2        
sequence_number=3    rbr_only=yes
/!50718 SET TRANSACTION ISOLATION LEVEL READ COMMITTED//!/;
SET @@SESSION.GTID_NEXT= 'ANONYMOUS'/!/;
# at 815
#201227 10:21:34 server id 1  end_log_pos 887 CRC32 
0x505d2069  Query   thread_id=2     exec_time=0     
error_code=0
SET TIMESTAMP=1609060894/!/;