Using twig, how to show a message on the frontend if a field is empty?
The fact that you are in the field template is proof for a non-empty field. So you need code outside of the field template to show a message. This can be PHP like the module you've linked or TWIG in a different template.
For example:
node.html.twig
{% if node.field_example.isempty %}
  &lt;p&gt;Field is empty&lt;/p&gt;
{% endif %}