It looks like you have your keymap mostly right, but it seems you have made a few typos. For the most part all of the rows and columns of the Phantom matrix correspond to the rows and columns of the switch layout. For the case of this macro, it is set up such that rows 0-5 on the phantom PCB correspond to rows 0-5 in the macro, and columns 0-16 on the phantom PCB correspond to columns A-Q in the macro.
For starters, I was looking at these two lines (44 and 49) in your keymap,
K1A, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1L, K1N, K10, K1P, K1Q, K1R, \
and
/* 1 */ { KC_##K1A, KC_NO , KC_##K1C, KC_##K1D, KC_##K1E, KC_##K1F, KC_##K1G, KC_##K1H, KC_##K1I, KC_##K1J, KC_##K1K, KC_##K1L, KC_##K1N, KC_##K1O, KC_##K1P, KC_##K1Q, KC_##K1R}, \
And while they should technically work (each part of the macro glues the correct strings together), it would be stylistically correct to have them like this:
K1A, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1L, K1M, K1N, K1O, K1P, K1Q, \
and
/* 1 */ { KC_##K1A, KC_NO , KC_##K1C, KC_##K1D, KC_##K1E, KC_##K1F, KC_##K1G, KC_##K1H, KC_##K1I, KC_##K1J, KC_##K1K, KC_##K1L, KC_##K1M, KC_##K1N, KC_##K1O, KC_##K1P, KC_##K1Q}, \
This makes more sense, because anybody who wants to make changes to your keymap wont have to wonder how there came to be an R'th column in the matrix.
As for the layers, there seems to be one more typo. On line 118, you seem to have a misplaced ')'
Also, I think you may be using the wrong keycodes for your numpad-like section. According to the source, the KC_MEM_ keycodes are not actually used. I am pretty sure KP_MEM_DIV should be KC_PSLS, KP_MEM_MUL should be KC_PAST, KP_MEM_SUB should be KC_PMNS, and KP_MEM_ADD should be KC_PPLS. You may also want to change DOT to PDOT to make it use the numpad dot keycode instead of the ". >" keycode. Also keep in mind that these keycodes need the numlock on in order to function as intended.