Difference between MultiDiGraph and DiGraph
The first way (with DiGraphs) is correct, but the two paths [0, 5] and [0, 5, '*'] both have the same (weighted) length, and the method just returns one of them.  Which one depends on how your version of python orders dictionaries, but I think since vertex 5 appears first in the topological ordering it's rather likely to appear first.

You could hack it by making the edges into '*' have weight 1, then subtract that from the longest path length.

dag_longest_path doesn't appear to be built to work for MultiDiGraphs.  For a vertex's predecessors' .items(), a DiGraph has just the dictionary of attributes, but the MultiDigraph has a dictionary of edge-attributes pairs.  dag_longest_path doesn't try to take that into account, so never sees any weight attribute to use.