I don't think you need to create a function here. And the code can be made quite simple: 

```python
data['product_versions'] = [
    {'product': product, 'version': x} 
    for x in sorted(versions, reverse=True)
]
```