Nightmare Puzzlang translator
APL (Dyalog Unicode), 57 bytes

¯1~⍨,1↓∘⍉∘⌽⍣4⊢{2 2⌷⍵:2⊥(~¯9↑5↑1)/,⍵⋄¯1}⌺3 3⊢⍉∘(¯1∘↑⍪⊢⍪1∘↑)⍣2⊢'X'=⎕

Try it online!
A full program which takes a binary matrix through STDIN, returns an array of codepoints.
Explanation
x¯1~⍨,1↓∘⍉∘⌽⍣4⊢{2 2⌷⍵:2⊥(~¯9↑5↑1)/,⍵⋄¯1}⌺3 3⊢⍉∘(¯1∘↑⍪⊢⍪1∘↑)⍣2⊢'X'=⎕
⎕ take input
'X'=  boolean matrix where 'X's are 1s
⍉∘(...)⍣2⊢ do the following twice:
¯1∘↑⍪⊢⍪1∘↑ pad each row with its wraparound on both sides
⍉∘ and transpose
{...}⌺3 3⊢ then, do the following for each 3x3 window:
2 2⌷⍵: if the middle element is 1:
2⊥(~¯9↑5↑1)/,⍵ decode the rest of the window as binary
⋄¯1 Otherwise, return ¯1.
⍣4⊢ Do the following 4 times:
1↓∘⍉∘⌽ rotate 90°, drop first row (remove the border cells)
, flatten into a simple array
¯1~⍨ remove all ¯1s