You posted a command that doesn't do what you want and described it's output, but you didn't tell us what you DO want so this is a guess but maybe it'll be useful. It prints the 2 lines before and 3 lines after some regexp:
$ cat file
a
b
c
d
FOO
e
f
g
h
i
j
FOO
k
l
m
n
o
$ awk -v re="FOO" -v b=2 -v a=3 'NR==FNR{line[FNR]=$0;next} $0 ~ re{for (i=(FNR-b);i<=(FNR+a);i++) print line[i]; print "=====" }' file file
c
d
FOO
e
f
g
=====
i
j
FOO
k
l
m
=====