$lf stands for line feed
$base(2J6PB,26,36) => QUIT
$base(38HB3,26,36,5) => 0WNED
so here is what is sent to the irc server with $chan = #test for example
CTCP #test :
QUIT 0WNED
So the server interprets the first line and may send you back an error but it also interprets the second line as a separate command.
So you're disconnected from the server
