Before you get too far in the weeds, you might want to check if the Cheapest Energy Hours macro does what you want and works with your source sensor.
Otherwise you can take a look at the following:
{% set price_list = state_attr('sensor.current_market_price_czk_kwh', 'today_hourly_prices') %}
{% set ns = namespace(hour_price=[])%}
{% for price in price_list %}
{% set ns.hour_price = ns.hour_price + [dict(hour=loop.index-1, price=price)] %}
{% endfor %}
{{ ns.hour_price | sort(attribute='price') | list }}