Retrieve Asset Filename from an entry, inside a matrix field
I would first check if you actually set up the Field handles you are currently using in your template:

Matrix Field handle: 'contentPrimary'
Block Type handle: 'widget'
Entries Field handle: 'widgetPrimary'
Assets Field handle: 'widgets'  

Then try to use the first() method instead of direct access to the array.
Or use direct access only after adding find() method that creates an array out of your ElementCriteriaModel. Edit: Direct access like this: myArray[0] should also work with an ElementCriteriaModel, but throws errors if no first elements exists (→ read Brandon's answer on this topic for more info).

{% for block in entry.contentPrimary %}
    {% switch block.type %}
        {% case "widget" %}
            {% set relatedEntry = block.widgetPrimary.first() %}
            {% if relatedEntry %}
                {% set asset = relatedEntry.widgets.first() %}
                {% if asset %}
                    {{ asset.title }}
                {% endif %}
            {% endif %}
    {% endswitch %}
{% endfor %}