Edit
Invalid Answer
The answer below is invalid as get_the_id() and get_the_ID() both return the required ID of the post inside the Loop. Thanks to @Jess_Pinkman for pointing it out.
Your code should be working fine, but the only issue is you are using an incorrect function to get the ID of the post inside the Loop.
To get the ID of the post inside the loop, you need to use the function get_the_ID().
What your are using is get_the_id() when, in reality, it’s get_the_ID(). There’s a lot of difference in that.
$post_id = get_the_id(); // This will not return anything since the
// function doesn't even exist, so $post_id
// will be empty.
Since get_the_id() doesn’t return anything, the $post_id variable remains empty. So when the get_post_meta() function is run, it doesn’t know which post’s meta to get as there’s no given ID. If you enabled WordPress Debug Mode, it would even give you a few errors.
To get the meta, you would need to use the correct function, i.e. get_the_ID() as given below.
$post_id = get_the_ID();