Aligning one grid to another when rotation is already applied

Hey guys, check out this other thread I posted- Creating a grid with bmesh results in 0,0,0 rotation

Icythe gives a solution there. The missing link is using invert rotation on the grids matrix to get it back to zero before placing it on the cube.