A Python correction to get your issues (moreover, was too long to get a minimum C++ project to debug ;) )
layer = iface.activeLayer()
layerRenderer= layer.renderer()
mSingleRenderer = QgsSingleSymbolRenderer.convertFromRenderer(layerRenderer)
symbol# No need to instantiate here
#symbol = QgsMarkerSymbol()
style = {
"name": "square",
"color": "yellow"
}
# Issue 1: you create a symbol but do not assign it
# (not void function, it returns a new element)
new_sym = symbolQgsMarkerSymbol.createSimple(style)
# Commented as it was already working with above code
# symbol.setColor(QColor(255,255,255));
mSingleRenderer.setSymbol(new_sym)
# Issue 2: Forgot to reassign the newly created renderer to your layer
layer.setRenderer(mSingleRenderer)
layer.triggerRepaint()
# Did not test, commented so can be tested "standalone" in PyQGIS
# mLayerTreeView.refreshLayerSymbology(layer.id())