This behaviour is the same on all Stack Exchange sites, and it is documented in the editing help. A list item continues until a line is reached that has no indent. This allows you to have multiple paragraphs, quoted text, and code blocks inside a list item.
If you want to follow a numbered list by a code block (without the code block becoming part of the list item), put an HTML comment after the list and before the code block, like this:
1. numbered list
1. numbered list
<!-- comment here -->
code block
code block