Hi Justyna,
I suppose you used the Focal Statistics tool and switched the option "Ignore NoData" on, right? This is OK. What you need to realize though, is that pixels that have NoData value in your input raster, but have Data cells in their direct vicinity will receive a value too.
To set these pixels to NoData again, you can you the Con Tool (Spatial Analyst\Conditional\Con). Use your input raster (first image in your post) from the previous step as conditional raster, leave the expression blank, use the focal statistics raster as "true raster" and leave the "false raster" empty.
This will set the pixels outside the area to NoData.
Kind regards,
Xander